From bcfd8e147387025db75d5ee15168405aad62730e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 5 Oct 2018 15:07:32 +0300 Subject: Anonymous comments --- juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'juick-server/src/main/java/com') diff --git a/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java b/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java index 8bf0cebc..7412705e 100644 --- a/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java +++ b/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java @@ -18,6 +18,7 @@ package com.juick.service; import com.juick.*; +import com.juick.model.AnonymousUser; import com.juick.model.PrivacyOpts; import com.juick.model.ResponseReply; import com.juick.server.util.HttpNotFoundException; @@ -70,7 +71,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ msg.setReplyto(rs.getInt(3)); User user = new User(); user.setUid(rs.getInt(4)); - user.setName(rs.getString(5)); + user.setName(Optional.ofNullable(rs.getString(5)).orElse(AnonymousUser.INSTANCE.getName())); user.setBanned(rs.getBoolean(6)); user.setUri(URI.create(Optional.ofNullable(rs.getString(22)).orElse(StringUtils.EMPTY))); msg.setUser(user); -- cgit v1.2.3