Author: jonesde
Date: Wed Jul 21 08:01:14 2010
New Revision: 966130
URL:
http://svn.apache.org/viewvc?rev=966130&view=revLog:
Fixed NPE, improved handling
Modified:
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java?rev=966130&r1=966129&r2=966130&view=diff==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java Wed Jul 21 08:01:14 2010
@@ -100,10 +100,16 @@ public class WidgetWorker {
for (Map.Entry<String, String> parameter: parameterMap.entrySet()) {
String parameterValue = null;
- if (!(parameter.getValue() instanceof String)) {
- // it's probably a String[], just get the first value
+ if (parameter.getValue() instanceof String) {
+ parameterValue = parameter.getValue();
+ } else {
Object parameterObject = parameter.getValue();
+
+ // skip null values
+ if (parameterObject == null) continue;
+
if (parameterObject instanceof String[]) {
+ // it's probably a String[], just get the first value
String[] parameterArray = (String[]) parameterObject;
parameterValue = parameterArray[0];
Debug.logInfo("Found String array value for parameter [" + parameter.getKey() + "], using first value: " + parameterValue, module);
@@ -111,8 +117,6 @@ public class WidgetWorker {
// not a String, and not a String[], just use toString
parameterValue = parameterObject.toString();
}
- } else {
- parameterValue = parameter.getValue();
}
if (needsAmp) {