myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From martink...@apache.org
Subject svn commit: r1137216 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java
Date Sat, 18 Jun 2011 17:14:02 GMT
Author: martinkoci
Date: Sat Jun 18 17:14:02 2011
New Revision: 1137216

URL: http://svn.apache.org/viewvc?rev=1137216&view=rev
Log:
Null check added for values where toString() returns null

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java?rev=1137216&r1=1137215&r2=1137216&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ErrorPageWriter.java
Sat Jun 18 17:14:02 2011
@@ -605,7 +605,13 @@ public final class ErrorPageWriter
                     writer.write("<tr><td>");
                     writer.write(key.replaceAll("<", TS));
                     writer.write("</td><td>");
-                    writer.write(entry.getValue().toString().replaceAll("<", TS));
+                    Object value = entry.getValue();
+                    // in some (very rare) situations value can be null or not null but with
null toString() representation
+                    if (value != null && value.toString() != null) {
+                        writer.write(value.toString().replaceAll("<", TS));
+                    } else {
+                        writer.write("null");
+                    }
                     writer.write("</td></tr>");
                     written = true;
                 }



Mime
View raw message