mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-28 13:45:14 +01:00
Might a fix a NPE when loading Players from Flatfile database
This commit is contained in:
parent
884df8f07d
commit
433efcf6c0
@ -55,15 +55,14 @@ public class BSBDatabase<T> {
|
|||||||
* @return the object or null if it cannot be loaded
|
* @return the object or null if it cannot be loaded
|
||||||
*/
|
*/
|
||||||
public T loadObject(String uniqueId) {
|
public T loadObject(String uniqueId) {
|
||||||
|
T result = null;
|
||||||
try {
|
try {
|
||||||
return handler.loadObject(uniqueId);
|
result = handler.loadObject(uniqueId);
|
||||||
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
|
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
|
||||||
| ClassNotFoundException | IntrospectionException e) {
|
| ClassNotFoundException | IntrospectionException e) {
|
||||||
logger.severe(() -> "Could not load object from database! " + e.getMessage());
|
logger.severe(() -> "Could not load object from database! " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
return result;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user