Browse code

[mapi] BM-15060 Fix: empty search result

Nicolas Lascombes authored on 18/07/2019 10:37:22
Showing 1 changed files
... ...
@@ -59,6 +59,7 @@ import org.slf4j.Logger;
59 59
 import org.slf4j.LoggerFactory;
60 60
 import org.vertx.java.core.json.JsonObject;
61 61
 
62
+import com.google.common.base.Strings;
62 63
 import com.google.common.collect.ImmutableMap;
63 64
 import com.netflix.spectator.api.Registry;
64 65
 
... ...
@@ -863,7 +864,7 @@ public class MailIndexService implements IMailIndexService {
863 864
 
864 865
 		boolean hasAttachment = !((List<String>) source.get("has")).isEmpty();
865 866
 
866
-		String preview = (String) source.get("preview");
867
+		String preview = Strings.nullToEmpty((String) source.get("preview"));
867 868
 
868 869
 		MessageSearchResult msr = new MessageSearchResult(contUid, itemId, subject, size, "IPM.Note", messageDate, from,
869 870
 				to, seen, flagged, hasAttachment, preview);