empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1335387 - /empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
Date Tue, 08 May 2012 09:06:52 GMT
Author: doebele
Date: Tue May  8 09:06:52 2012
New Revision: 1335387

URL: http://svn.apache.org/viewvc?rev=1335387&view=rev
Log:
EMPIREDB-140
bugfix: prevent null pointer exception for empty title

Modified:
    empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java

Modified: empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java?rev=1335387&r1=1335386&r2=1335387&view=diff
==============================================================================
--- empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
(original)
+++ empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
Tue May  8 09:06:52 2012
@@ -800,7 +800,7 @@ public class TagEncodingHelper implement
         else
             text = getDisplayText(StringUtils.toString(value));
         // Check for template
-        if (valIndex >= 0)
+        if (valIndex >= 0 && text!=null)
             text = StringUtils.replace(templ, "{}", text);
         return text;
     }
@@ -883,13 +883,15 @@ public class TagEncodingHelper implement
         // Use normal title
         if (title==null)
             title=column.getTitle();
-        // render now
+        // translate
         title = getDisplayText(title);
+        // handle empty string
+        if (StringUtils.isEmpty(title))
+            return "";
         // getColon
         if (colon) 
-        {
             title = title.trim() + ":";
-        }
+        // done
         return title;
     }
     



Mime
View raw message