aboutsummaryrefslogtreecommitdiff
path: root/juick-server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-16 15:07:57 +0300
committerGravatar Vitaly Takmazov2018-03-16 15:07:57 +0300
commitbffb71b70c6d6ff20b649de986e098ed0e7ddafe (patch)
treecf69070e34c4e37a1949b538fe0a8c631121f991 /juick-server
parentd71db6c54fca9d5735f38c0cb3fa624ae11d4d1c (diff)
server: fix NPE in mail processing
Diffstat (limited to 'juick-server')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Post.java2
1 files changed, 1 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 80ebe1a1..72ca8439 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
@@ -212,7 +212,7 @@ public class Post {
public void processMail(InputStream data) throws Exception {
MimeMessage msg = new MimeMessage(session, data);
logger.info("got msg {}", msg.toString());
- String from = msg.getFrom().length > 1 ? ((InternetAddress) msg.getSender()).getAddress()
+ String from = msg.getFrom() == null || msg.getFrom().length > 1 ? ((InternetAddress) msg.getSender()).getAddress()
: ((InternetAddress) msg.getFrom()[0]).getAddress();
User visitor = userService.getUserByEmail(from);