Changeset 5581


Ignore:
Timestamp:
Mar 8, 2011, 9:39:41 AM (11 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1583: NullPointerException? in ProjectKey?.getPermissions(Project) and ItemKey?.getPermissions(Group/User?)

Location:
branches/2.17-stable/src/core/net/sf/basedb/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.17-stable/src/core/net/sf/basedb/core/ItemKey.java

    r5345 r5581  
    304304  {
    305305    if (user == null) throw new InvalidUseOfNullException("user");
    306     return Permission.fromInt(getData().getUsers().get(user.getData()));
     306    return Permission.fromInt(IntegerUtil.getInt(getData().getUsers().get(user.getData())));
    307307  }
    308308
     
    319319  {
    320320    if (group == null) throw new InvalidUseOfNullException("group");
    321     return Permission.fromInt(getData().getGroups().get(group.getData()));
     321    return Permission.fromInt(IntegerUtil.getInt(getData().getGroups().get(group.getData())));
    322322  }
    323323
  • branches/2.17-stable/src/core/net/sf/basedb/core/ProjectKey.java

    r5345 r5581  
    273273  {
    274274    if (project == null) throw new InvalidUseOfNullException("project");
    275     return Permission.fromInt(getData().getProjects().get(project.getData()));
     275    return Permission.fromInt(IntegerUtil.getInt(getData().getProjects().get(project.getData())));
    276276  }
    277277 
Note: See TracChangeset for help on using the changeset viewer.