aboutsummaryrefslogtreecommitdiff
path: root/juick-server-xmpp/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server-xmpp/src/main/java/com')
-rw-r--r--juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java b/juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java
index a60b506d..fbf1a529 100644
--- a/juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java
+++ b/juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java
@@ -624,8 +624,9 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
incomingMessageJuick(user_from, msg.getFrom(), msg.getBody().trim(), null);
}
} catch (Exception e) {
- return;
+ logger.info("xmpp exception", e);
}
+ return;
}
int uid_to = userService.getUIDbyName(username);
@@ -680,7 +681,7 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
// new message
List<Tag> tags = tagService.fromString(command, false);
String body = command.substring(TagUtils.toString(tags).length());
- String attachmentType = StringUtils.isNotEmpty(attachment.toString()) ? attachment.toString().substring(attachment.toString().length() - 3) : null;
+ String attachmentType = attachment != null && StringUtils.isNotEmpty(attachment.toString()) ? attachment.toString().substring(attachment.toString().length() - 3) : null;
int mid = messagesService.createMessage(user_from.getUid(), body, attachmentType, tags);
subscriptionService.subscribeMessage(mid, user_from.getUid());
if (StringUtils.isNotEmpty(attachmentType)) {