Added exception catch for getClass in AddonsManager.

This commit is contained in:
tastybento 2020-02-14 08:12:49 -08:00
parent 8e994ffae9
commit 77a2a7add5

View File

@ -358,11 +358,14 @@ public class AddonsManager {
/**
* Finds a class by name that has been loaded by this loader
* @param name name of the class, not null
* @return Class the class
* @return Class the class or null if not found
*/
@Nullable
public Class<?> getClassByName(@NonNull final String name) {
try {
return classes.getOrDefault(name, loaders.values().stream().map(l -> l.findClass(name, false)).filter(Objects::nonNull).findFirst().orElse(null));
} catch (Exception e) {}
return null;
}
/**