|Title|NullPointerException while attaching file in un
|Date|01-May-2007 19:36:30 EEST
|Version|2.4.102
|Submitter|193.172.9.9
|[Bug criticality]|BadBug
|Browser version|Firefox 2.0.0.1
|[Bug status]|ClosedBug
|[PageProvider] used|FileSystemProvider
|Servlet Container|Tomcat 5.5.20
|Operating System|Linux kernel 2.6.20
|URL|attach file to any topic
|Java version|Sun JDK 1.5.0_11

I run an open wiki for personal use, so I disabled security (jspwiki.security=off in jspwiki.properties).

Trying to attach a file causes a NullPointerException in AuthorizationManager.checkPermission(WikiSession,Permission), because AllPermissions.getActions() returns null:

{{{
if (permission == null ||(permission.getActions().equals("login")))
{
   return false;
}
}}}
I flipped the .equals:
{{{
if (permission == null || ("login".equals(permission.getActions())))
}}}
I think this maintains the correct behaviour in secured wiki's, and fixes the bug in non-secured wiki's.

[Waiting for fix implementation |Bugs Waiting For Provided Fix To Be Implemented]

----
Fixed in 2.5.40

--HarryMetske