Opened 14 years ago

Last modified 14 years ago

#1583 closed defect

NullPointerException in ProjectKey.getPermissions(Project) and ItemKey.getPermissions(Group/User) — at Initial Version

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 2.17.1
Component: core Version:
Keywords: Cc:

Description

Calling one of the above methods with a Project/Group/User that hasn't been assigned any permissions result in a NullPointerException:

java.lang.NullPointerException
	at net.sf.basedb.core.ProjectKey.getPermissions(ProjectKey.java:275)
	at net.sf.basedb.reggie.servlet.InstallServlet$PermissionOptions.checkPermissions(InstallServlet.java:435)
	at net.sf.basedb.reggie.servlet.InstallServlet.checkAnnotationType(InstallServlet.java:218)
	at net.sf.basedb.reggie.servlet.InstallServlet.doGet(InstallServlet.java:107)

The reason is that an Integer (which is null) is auto-unboxed to an int in a call to Permission.fromInt(int).

Change History (0)

Note: See TracTickets for help on using tickets.