fix MessageBoard test for null data

pull/58/head
reger 9 years ago
parent 5b22c63030
commit 0c40401d28

@ -106,11 +106,11 @@ public class MessageBoard {
if (key.length() > categoryLength) key = key.substring(0, categoryLength); if (key.length() > categoryLength) key = key.substring(0, categoryLength);
while (key.length() < categoryLength) key += "_"; while (key.length() < categoryLength) key += "_";
key += dateString() + snString(); key += dateString() + snString();
record.put("author", ((authorName == null) || (authorName.isEmpty())) ? authorName : "anonymous"); record.put("author", ((authorName != null) && (!authorName.isEmpty())) ? authorName : "anonymous");
record.put("recipient", ((recName == null) || (recName.isEmpty())) ? recName : "anonymous"); record.put("recipient", ((recName != null) && (!recName.isEmpty())) ? recName : "anonymous");
record.put("ahash", (authorHash == null) ? authorHash : ""); record.put("ahash", (authorHash != null) ? authorHash : "");
record.put("rhash", (recHash == null) ? recHash : ""); record.put("rhash", (recHash != null) ? recHash : "");
record.put("subject", (subject == null) ? subject : ""); record.put("subject", (subject != null) ? subject : "");
record.put("message", (message == null) ? "" : Base64Order.enhancedCoder.encode(message)); record.put("message", (message == null) ? "" : Base64Order.enhancedCoder.encode(message));
record.put("read", "false"); record.put("read", "false");
} }

Loading…
Cancel
Save