Fixed NullPointerException

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2417 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2006-02-16 16:20:20 +00:00
parent 609d117e58
commit ccd57b218a

View File

@@ -69,16 +69,24 @@ public abstract class BaseDebugComponent extends SelfRenderingComponent
out.write("<tr><td>"); out.write("<tr><td>");
out.write(key.toString()); out.write(key.toString());
out.write("</td><td>"); out.write("</td><td>");
String value = session.get(key).toString(); Object obj = session.get(key);
if (value == null || value.length() == 0) if (obj == null)
{ {
out.write("&nbsp;"); out.write("null");
} }
else else
{ {
// replace any ; characters with ;<space> as that will help break up long lines String value = obj.toString();
value = value.replaceAll(";", "; "); if (value.length() == 0)
out.write(value); {
out.write("&nbsp;");
}
else
{
// replace any ; characters with ;<space> as that will help break up long lines
value = value.replaceAll(";", "; ");
out.write(value);
}
} }
out.write("</td></tr>"); out.write("</td></tr>");
} }