mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 10:37:59 +01:00
Merge pull request #480 from guusdk/sint_improve-notinroster
[sint] increase stability
This commit is contained in:
commit
f611941dcf
1 changed files with 11 additions and 1 deletions
|
@ -24,6 +24,7 @@ import org.jivesoftware.smack.SmackException.NotLoggedInException;
|
|||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
import org.jivesoftware.smack.packet.Presence;
|
||||
import org.jivesoftware.smack.packet.StanzaError;
|
||||
import org.jivesoftware.smack.roster.AbstractPresenceEventListener;
|
||||
import org.jivesoftware.smack.roster.PresenceEventListener;
|
||||
import org.jivesoftware.smack.roster.Roster;
|
||||
|
@ -99,7 +100,16 @@ public class IntegrationTestRosterUtil {
|
|||
if (c2Entry == null) {
|
||||
return;
|
||||
}
|
||||
roster.removeEntry(c2Entry);
|
||||
try {
|
||||
roster.removeEntry(c2Entry);
|
||||
} catch (XMPPErrorException e) {
|
||||
// Account for race conditions: server-sided, the item might already have been removed.
|
||||
if (e.getStanzaError().getCondition() == StanzaError.Condition.item_not_found) {
|
||||
// Trying to remove non-existing item. As it needs to be gone, this is fine.
|
||||
return;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue