[Ils-source] r1370 - branches/1.6/webapp

scribe at crosswire.org scribe at crosswire.org
Thu Dec 17 17:10:28 MST 2015


Author: scribe
Date: 2015-12-17 17:10:27 -0700 (Thu, 17 Dec 2015)
New Revision: 1370

Modified:
   branches/1.6/webapp/admin_profile.jsp
Log:
fixed bug which could attempt to loop through groups even if groups is null


Modified: branches/1.6/webapp/admin_profile.jsp
===================================================================
--- branches/1.6/webapp/admin_profile.jsp	2015-12-17 21:36:26 UTC (rev 1369)
+++ branches/1.6/webapp/admin_profile.jsp	2015-12-18 00:10:27 UTC (rev 1370)
@@ -273,9 +273,11 @@
                 // modifying an existing user
 		if (orig.getUserProfileID() > 0) {
 			String oldGroups = "";
-			for (int cg : currentRoles) {
-				if (oldGroups.length() > 0) oldGroups += ", ";
-				oldGroups += cg;
+			if (currentRoles != null) {
+				for (int cg : currentRoles) {
+					if (oldGroups.length() > 0) oldGroups += ", ";
+					oldGroups += cg;
+				}
 			}
 			eventsLogger.info("User " + current.getUserProfileNum() + " ROLES changed from " + oldGroups + " to " + newGroups + " by user: " + ilsSession.getCurrentUserProfile().getUserProfileNum());
                 }
@@ -291,9 +293,11 @@
                 // modifying an existing user
 		if (orig.getUserProfileID() > 0) {
 			String oldGroups = "";
-			for (int cg : currentLocations) {
-				if (oldGroups.length() > 0) oldGroups += ", ";
-				oldGroups += cg;
+			if (currentLocations != null) {
+				for (int cg : currentLocations) {
+					if (oldGroups.length() > 0) oldGroups += ", ";
+					oldGroups += cg;
+				}
 			}
 			eventsLogger.info("User " + current.getUserProfileNum() + " WORKGROUPS changed from " + oldGroups + " to " + newGroups + " by user: " + ilsSession.getCurrentUserProfile().getUserProfileNum());
                 }




More information about the Ils-source mailing list