1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +01:00

Fix wrong boolean condition in async API

inverse boolean condition, correct is: "if packetListener has been
removed, then we received no response" and add check for
exceptionCallback being null.
This commit is contained in:
Florian Schmaus 2014-08-21 12:02:32 +02:00
parent 76f8895ae3
commit 28629e0e7f

View file

@ -1108,7 +1108,9 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
@Override @Override
public void run() { public void run() {
boolean removed = removePacketListener(packetListener); boolean removed = removePacketListener(packetListener);
if (!removed) { // If the packetListener got removed, then it was never run and
// we never received a response, inform the exception callback
if (removed && exceptionCallback != null) {
exceptionCallback.processException(new NoResponseException()); exceptionCallback.processException(new NoResponseException());
} }
} }