Skip to content
Snippets Groups Projects
Commit 20c46180 authored by Alinga Yeung's avatar Alinga Yeung
Browse files

Story ac2. Added code to check for null subject.

parent 9ce9301b
No related branches found
No related tags found
No related merge requests found
...@@ -140,12 +140,15 @@ public class GetUserAction extends AbstractUserAction ...@@ -140,12 +140,15 @@ public class GetUserAction extends AbstractUserAction
boolean isServops = false; boolean isServops = false;
AccessControlContext acc = AccessController.getContext(); AccessControlContext acc = AccessController.getContext();
Subject subject = Subject.getSubject(acc); Subject subject = Subject.getSubject(acc);
for (Principal principal : subject.getPrincipals()) if (subject != null)
{ {
if (principal.getName().equals(this.getAugmentUserDN())) for (Principal principal : subject.getPrincipals())
{ {
isServops = true; if (principal.getName().equals(this.getAugmentUserDN()))
break; {
isServops = true;
break;
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment