svn commit: r1165233 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1165233 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java

adrianc
Author: adrianc
Date: Mon Sep  5 10:47:32 2011
New Revision: 1165233

URL: http://svn.apache.org/viewvc?rev=1165233&view=rev
Log:
Fix NPE I introduced in my previous commit. Reported by Chatree Srichart.

Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=1165233&r1=1165232&r2=1165233&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Mon Sep  5 10:47:32 2011
@@ -2127,7 +2127,7 @@ public class ModelFormField {
 
         public String getDescription(Map<String, Object> context) {
             String retVal = null;
-            if (!this.description.isEmpty()) {
+            if (this.description != null && !this.description.isEmpty()) {
                 retVal = this.description.expandString(context);
             } else {
                 retVal = this.modelFormField.getEntry(context);
@@ -2213,7 +2213,7 @@ public class ModelFormField {
                     throw new IllegalArgumentException(errMsg);
                 }
             }
-            if (!this.description.isEmpty() && retVal != null && this.getModelFormField().getEncodeOutput()) {
+            if (this.description != null && !this.description.isEmpty() && retVal != null && this.getModelFormField().getEncodeOutput()) {
                 StringUtil.SimpleEncoder simpleEncoder = (StringUtil.SimpleEncoder) context.get("simpleEncoder");
                 if (simpleEncoder != null) {
                     retVal = simpleEncoder.encode(retVal);