From 0c40401d28fde1b036c780f796205a09f26802af Mon Sep 17 00:00:00 2001 From: reger Date: Tue, 7 Jun 2016 23:34:42 +0200 Subject: [PATCH] fix MessageBoard test for null data --- source/net/yacy/data/MessageBoard.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/net/yacy/data/MessageBoard.java b/source/net/yacy/data/MessageBoard.java index 2c9df93c7..f585d8c19 100644 --- a/source/net/yacy/data/MessageBoard.java +++ b/source/net/yacy/data/MessageBoard.java @@ -106,11 +106,11 @@ public class MessageBoard { if (key.length() > categoryLength) key = key.substring(0, categoryLength); while (key.length() < categoryLength) key += "_"; key += dateString() + snString(); - record.put("author", ((authorName == null) || (authorName.isEmpty())) ? authorName : "anonymous"); - record.put("recipient", ((recName == null) || (recName.isEmpty())) ? recName : "anonymous"); - record.put("ahash", (authorHash == null) ? authorHash : ""); - record.put("rhash", (recHash == null) ? recHash : ""); - record.put("subject", (subject == null) ? subject : ""); + record.put("author", ((authorName != null) && (!authorName.isEmpty())) ? authorName : "anonymous"); + record.put("recipient", ((recName != null) && (!recName.isEmpty())) ? recName : "anonymous"); + record.put("ahash", (authorHash != null) ? authorHash : ""); + record.put("rhash", (recHash != null) ? recHash : ""); + record.put("subject", (subject != null) ? subject : ""); record.put("message", (message == null) ? "" : Base64Order.enhancedCoder.encode(message)); record.put("read", "false"); }