mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-27 05:05:18 +01:00
Added exception catch for getClass in AddonsManager.
This commit is contained in:
parent
8e994ffae9
commit
77a2a7add5
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user