[izpack-changes] r1529 - izpack-src/trunk/src/lib/com/izforge/izpack/panels

noreply at berlios.de noreply at berlios.de
Mon Aug 21 16:27:21 CEST 2006


Author: tschwarze
Date: 2006-08-21 16:27:20 +0200 (Mon, 21 Aug 2006)
New Revision: 1529

Modified:
   izpack-src/trunk/src/lib/com/izforge/izpack/panels/UserInputPanel.java
Log:
[bug] resolve minor logic bug - prevent possible NPE

Modified: izpack-src/trunk/src/lib/com/izforge/izpack/panels/UserInputPanel.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/panels/UserInputPanel.java	2006-08-17 14:58:24 UTC (rev 1528)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/panels/UserInputPanel.java	2006-08-21 14:27:20 UTC (rev 1529)
@@ -894,21 +894,23 @@
             // If so, then add them to validateParamMap.
             // ----------------------------------------------------------
             validateParams = element.getChildrenNamed(RULE_PARAM);
-            if (validateParams != null && validateParams.size() > 0 && validateParamMap == null)
+            if (validateParams != null && validateParams.size() > 0) 
             {
-
-                validateParamMap = new HashMap();
                 hasParams = true;
+                
+                if (validateParamMap == null)
+                    validateParamMap = new HashMap();
 
+                for (Iterator it = validateParams.iterator(); it.hasNext();)
+                {
+                    element = (XMLElement) it.next();
+                    paramName = element.getAttribute(RULE_PARAM_NAME);
+                    paramValue = element.getAttribute(RULE_PARAM_VALUE);
+                    validateParamMap.put(paramName, paramValue);
+                }
+                
             }
 
-            for (Iterator it = validateParams.iterator(); it.hasNext();)
-            {
-                element = (XMLElement) it.next();
-                paramName = element.getAttribute(RULE_PARAM_NAME);
-                paramValue = element.getAttribute(RULE_PARAM_VALUE);
-                validateParamMap.put(paramName, paramValue);
-            }
         }
 
         element = spec.getFirstChildNamed(PROCESSOR);




More information about the izpack-changes mailing list