Commits

Tim Olsen committed 13b757a Merge

Merge xnat_1_4 modifications

Comments (0)

Files changed (1)

src/main/java/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.");
             }