- Protect about possible issues calling toString in escapeXml(Object).
authorremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 17 Apr 2007 14:10:07 +0000 (14:10 +0000)
committerremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 17 Apr 2007 14:10:07 +0000 (14:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@529612 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/manager/JspHelper.java

index 39df89e..d07ae35 100644 (file)
@@ -180,8 +180,15 @@ public class JspHelper {
     }
 
     public static String escapeXml(Object obj) {
-       return obj == null ? "" : escapeXml(String.valueOf(obj));
+        String value = null;
+        try {
+            value = (obj == null) ? null : String.valueOf(obj);
+        } catch (Exception e) {
+            // Ignore
+        }
+        return escapeXml(value);
     }
+
     /**
      * Performs the following substring replacements
      * (to facilitate output to XML/HTML pages):