Changeset 7705


Ignore:
Timestamp:
May 13, 2019, 8:36:31 AM (2 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #2175: NullPointerException? when impersonating a user

We need to make sure that the information about role membership is up to date when trying to inactivate a role.

The reason that it worked for regular logins was that a check for permissions to use the web client is made before roles are inactivated. The check triggered a re-load and the 'roles' variable was not null.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.15-stable/src/core/net/sf/basedb/core/Keyring.java

    r7689 r7705  
    799799  synchronized boolean setRoleInactive(int roleId, boolean inactive)
    800800  {
     801    if (getReload()) reload();
    801802    // Ignore roles that the user is not a member of
    802     if (!roles.contains(roleId)) return false;
     803    if (roles == null || !roles.contains(roleId)) return false;
    803804   
    804805    if (inactiveRoles == null) inactiveRoles = new HashSet<Integer>();
Note: See TracChangeset for help on using the changeset viewer.