Author: adrianc
Date: Mon Sep 5 10:47:32 2011
New Revision: 1165233
URL:
http://svn.apache.org/viewvc?rev=1165233&view=revLog:
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);