1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-26 12:37:58 +01:00

NPE check in SmackConfiguration

This commit is contained in:
Florian Schmaus 2014-03-09 23:43:34 +01:00
parent 1f2183605c
commit f3e007bad5

View file

@ -291,7 +291,13 @@ public final class SmackConfiguration {
try {
loadSmackClass(classToLoad, optional);
} catch (Exception e) {
exceptions.add(e);
// Don't throw the exception if an exceptions collection is given, instead
// record it there. This is used for unit testing purposes.
if (exceptions != null) {
exceptions.add(e);
} else {
throw e;
}
}
}
}