Skip to content

Commit

Permalink
Fix NPE in UsrGrpAdminServlet
Browse files Browse the repository at this point in the history
In commit 11d268f the
UsrGrpAdminServlet's constructor was modified to get the CMSEngine
object from the servletContext before the field was initialized
which triggered a NullPointerException. To fix the problem the code
in the constructor has been moved into init() so that it will run
after the servletContext initialization.

https://issues.redhat.com/browse/RHEL-626
  • Loading branch information
edewata committed Jul 12, 2023
1 parent 3c3f790 commit 5afb3c0
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,14 @@ public class UsrGrpAdminServlet extends AdminServlet {
private static final String MULTI_ROLE_ENABLE = "multiroles.enable";
private static final String MULTI_ROLE_ENFORCE_GROUP_LIST = "multiroles.false.groupEnforceList";

/**
* Constructs User/Group manager servlet.
*/
public UsrGrpAdminServlet() {
super();
CMSEngine engine = getCMSEngine();
mAuthz = engine.getAuthzSubsystem();
}

/**
* Initializes this servlet.
*/
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
CMSEngine engine = getCMSEngine();
mAuthz = engine.getAuthzSubsystem();
mMgr = engine.getUGSubsystem();
}

Expand Down

0 comments on commit 5afb3c0

Please sign in to comment.