diff options
author | Vitaly Takmazov | 2017-02-16 13:32:57 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-02-16 13:32:57 +0300 |
commit | 40a5a0091fb949a0533d0d5b7716c3229d19420d (patch) | |
tree | cdf7d0e46ac5e10da952b93cca706bd0866f7827 /juick-xmpp/src/main/java/com/juick/components | |
parent | b3ac09ede10854dd277989d7296416c34916eeb1 (diff) |
juick-xmpp: fix NPE
Diffstat (limited to 'juick-xmpp/src/main/java/com/juick/components')
-rw-r--r-- | juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java | 9 |
1 files changed, 7 insertions, 2 deletions
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 3304f73f6..60268284b 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("<db:verify from='" + vto + "' to='" + vfrom + "' id='" + vid + "' type='valid'/>"); |