Only set custom class when valid class

This commit is contained in:
T00thpick1 2013-07-01 00:34:54 -04:00
parent 36b09421e8
commit f5eb7a10de

View File

@ -40,10 +40,10 @@ public class DatabaseManagerFactory {
public static void setCustomDatabaseManagerClass(Class<? extends DatabaseManager> clazz) {
try {
clazz.getConstructor((Class<?>) null);
customManager = clazz;
} catch (Throwable e) {
throw new IllegalArgumentException("Provided database manager class must have an empty constructor", e);
}
customManager = clazz;
}
public static Class<? extends DatabaseManager> getCustomDatabaseManagerClass() {