Fix a NullPointerException in DatabaseUtilities.writeTable

git-svn-id: http://webgoat.googlecode.com/svn/trunk@134 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
rogan.dawes 2007-07-10 11:49:15 +00:00
parent b7bb9e4d17
commit 4cae9985f6

View File

@ -158,8 +158,10 @@ public class DatabaseUtilities
for (int i = 1; i < (numColumns + 1); i++) for (int i = 1; i < (numColumns + 1); i++)
{ {
row.addElement(new TD(results.getString(i).replaceAll(" ", String str = results.getString(i);
"&nbsp;"))); if (str == null)
str = "";
row.addElement(new TD(str.replaceAll(" ", "&nbsp;")));
} }
t.addElement(row); t.addElement(row);