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,6 +140,8 @@ public class GetUserAction extends AbstractUserAction ...@@ -140,6 +140,8 @@ 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);
if (subject != null)
{
for (Principal principal : subject.getPrincipals()) for (Principal principal : subject.getPrincipals())
{ {
if (principal.getName().equals(this.getAugmentUserDN())) if (principal.getName().equals(this.getAugmentUserDN()))
...@@ -148,6 +150,7 @@ public class GetUserAction extends AbstractUserAction ...@@ -148,6 +150,7 @@ public class GetUserAction extends AbstractUserAction
break; break;
} }
} }
}
return isServops; return isServops;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment