mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 02:27:58 +01:00
[sinttest] Treat NPE as test failure not as abort condition
This commit is contained in:
parent
c9af25c674
commit
f64288ba6d
1 changed files with 8 additions and 0 deletions
|
@ -590,6 +590,14 @@ public class SmackIntegrationTestFramework {
|
|||
if (e instanceof InterruptedException) {
|
||||
throw (InterruptedException) e;
|
||||
}
|
||||
|
||||
// We handle NullPointerException as a non fatal exception, as they are mostly caused by an invalid reply where
|
||||
// a extension element is missing. Consider for example
|
||||
// assertEquals(StanzaError.Condition.foo, response.getError().getCondition())
|
||||
// Otherwise NPEs could be caused by an internal bug in Smack, e.g. missing null handling.
|
||||
if (e instanceof NullPointerException) {
|
||||
return (NullPointerException) e;
|
||||
}
|
||||
if (e instanceof RuntimeException) {
|
||||
throw (RuntimeException) e;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue