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
Fixed in 2.5.40
Add new attachment
Only authorized users are allowed to upload new attachments.