svn commit: r732296 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java

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

svn commit: r732296 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java

jleroux@apache.org
Author: jleroux
Date: Wed Jan  7 02:30:38 2009
New Revision: 732296

URL: http://svn.apache.org/viewvc?rev=732296&view=rev
Log:
A temporary patch (workaround) for the minipoll bug reported on user ML. I will open a Jira issue ASAS I will get access to Jira (DSN resolution issue currently it seems)

Modified:
    ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java?rev=732296&r1=732295&r2=732296&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java Wed Jan  7 02:30:38 2009
@@ -678,14 +678,16 @@
                 GenericValue value;
                 while (((value = (GenericValue) eli.next()) != null)) {
                     String optionId = value.getString("surveyOptionSeqId");
-                    Long optCount = (Long) result.remove(optionId);
-                    if (optCount == null) {
-                        optCount = Long.valueOf(1);
-                    } else {
-                        optCount = Long.valueOf(1 + optCount.longValue());
+                    if (UtilValidate.isNotEmpty(optionId)) {
+                        Long optCount = (Long) result.remove(optionId);
+                        if (optCount == null) {
+                            optCount = Long.valueOf(1);
+                        } else {
+                            optCount = Long.valueOf(1 + optCount.longValue());
+                        }
+                        result.put(optionId, optCount);
+                        total++; // increment the count
                     }
-                    result.put(optionId, optCount);
-                    total++; // increment the count
                 }
     
                 eli.close();