From 40a5a0091fb949a0533d0d5b7716c3229d19420d Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 16 Feb 2017 13:32:57 +0300 Subject: juick-xmpp: fix NPE --- .../src/main/java/com/juick/components/s2s/ConnectionIn.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'juick-xmpp/src/main/java/com/juick/components') diff --git a/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java b/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java index 3304f73f..60268284 100644 --- a/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java +++ b/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java @@ -106,8 +106,13 @@ public class ConnectionIn extends Connection implements Runnable { updateTsRemoteData(); boolean valid = false; if (vfrom != null && vto != null && vid != null && vkey != null) { - String dialbackKey = xmpp.getConnectionOut(vfrom, false).dbKey; - valid = vkey.equals(dialbackKey); + ConnectionOut c = xmpp.getConnectionOut(vfrom, false); + if (c == null) { + logger.warn("outgoing connection to {} not found", vfrom); + } else { + String dialbackKey = c.dbKey; + valid = vkey.equals(dialbackKey); + } } if (valid) { sendStanza(""); -- cgit v1.2.3