NPE check in SmackConfiguration

This commit is contained in:
Florian Schmaus 2014-03-09 23:43:34 +01:00
parent 1f2183605c
commit f3e007bad5
1 changed files with 7 additions and 1 deletions

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;
}
}
}
}