diff options
Diffstat (limited to 'src/main/java/com/juick/www/api')
-rw-r--r-- | src/main/java/com/juick/www/api/Service.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/com/juick/www/api/Service.java b/src/main/java/com/juick/www/api/Service.java index 8b18b125f..c3ce12423 100644 --- a/src/main/java/com/juick/www/api/Service.java +++ b/src/main/java/com/juick/www/api/Service.java @@ -98,8 +98,11 @@ public class Service { return; } } - String from = msg.getFrom() == null || msg.getFrom().length > 1 ? ((InternetAddress) msg.getSender()).getAddress() - : ((InternetAddress) msg.getFrom()[0]).getAddress(); + if (msg.getFrom() == null || msg.getFrom().length == 0) { + logger.info("Missing from/sender headers"); + return; + } + String from = ((InternetAddress) msg.getFrom()[0]).getAddress(); User visitor = userService.getUserByEmail(from); if (!visitor.isAnonymous()) { |