aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Post.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/Post.java b/juick-server/src/main/java/com/juick/server/api/Post.java
index 1dd18b66..827b9ffc 100644
--- a/juick-server/src/main/java/com/juick/server/api/Post.java
+++ b/juick-server/src/main/java/com/juick/server/api/Post.java
@@ -225,7 +225,9 @@ public class Post {
body[0] = rid > 0 ? String.format("#%d/%d %s", mid, rid, body[0])
: String.format("#%d %s", mid, body[0]);
}
- xmppConnection.incomingMessageJuick(visitor, null, body[0], URI.create(String.format("juick://%s", attachmentFName[0])));
+ URI attachmentUri = StringUtils.isNotEmpty(attachmentFName[0]) ? URI.create(String.format("juick://%s", attachmentFName[0]))
+ : URI.create(StringUtils.EMPTY);
+ xmppConnection.incomingMessageJuick(visitor, null, body[0], attachmentUri);
} else {
logger.info("not registered: {}", from);
}