Commits

Tim Olsen  committed 6c5b2a9

BUG Fix: user null check missing. The first time this code is run (during installation) on the security.xml, there is no user account.

  • Participants
  • Parent commits 942c3c5

Comments (0)

Files changed (1)

File org/nrg/xft/utils/SaveItemHelper.java

 		}
 
 		if(i.getItem().getGenericSchemaElement().getType().getForeignPrefix().equals(XFT.PREFIX)){
-        	if (!((XDATUser)user).checkRole("Administrator"))
+        	if (user!=null && !((XDATUser)user).checkRole("Administrator"))
             {
         		throw new InvalidPermissionException("Only site administrators can store core documents.");
             }
 		}
 
 		if(i.getItem().getGenericSchemaElement().getType().getForeignPrefix().equals(XFT.PREFIX)){
-        	if (!((XDATUser)user).checkRole("Administrator"))
+        	if (user!=null && !((XDATUser)user).checkRole("Administrator"))
             {
         		throw new InvalidPermissionException("Only site administrators can store core documents.");
             }