From f11443579c2ccedaf5949cf718183c7c564098ad Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 30 Mar 2018 14:30:46 +0300 Subject: server: fix exception --- juick-server/src/main/java/com/juick/server/CommandsManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'juick-server/src/main/java') diff --git a/juick-server/src/main/java/com/juick/server/CommandsManager.java b/juick-server/src/main/java/com/juick/server/CommandsManager.java index 74c443cf..9178dbb9 100644 --- a/juick-server/src/main/java/com/juick/server/CommandsManager.java +++ b/juick-server/src/main/java/com/juick/server/CommandsManager.java @@ -466,7 +466,7 @@ public class CommandsManager { tagService.updateTags(mid, messageTags); return CommandResult.fromString("Tags are updated"); } else { - String attachmentType = attachment != null ? attachment.toString().substring(attachment.toString().length() - 3) : null; + String attachmentType = StringUtils.isNotEmpty(attachment.toString()) ? attachment.toString().substring(attachment.toString().length() - 3) : null; int newrid = messagesService.createReply(mid, rid, user.getUid(), txt, attachmentType); if (StringUtils.isNotEmpty(attachmentType)) { String attachmentFName = attachment.getScheme().equals("juick") ? attachment.getHost() -- cgit v1.2.3