1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-08 07:36:42 +02:00

[GM] Catch all of the null.

This commit is contained in:
KHobbits
2013-02-01 02:52:41 +00:00
parent 27697c7b0c
commit 5c1e235f15

View File

@@ -823,25 +823,29 @@ public class WorldDataHolder {
* nothing.
*/
} else {
try {
if (nodeData instanceof List) {
for (Object o : ((List) nodeData)) {
/*
* Only add this permission if it's not empty
*/
if (!o.toString().isEmpty())
if (!o.toString().isEmpty()) {
thisUser.addPermission(o.toString());
}
}
} else if (nodeData instanceof String) {
try {
/*
* Only add this permission if it's not empty
*/
if (!nodeData.toString().isEmpty())
if (!nodeData.toString().isEmpty()) {
thisUser.addPermission(nodeData.toString());
}
}
} catch (NullPointerException e) {
// Ignore this entry as it's null.
}
}
thisUser.sortPermissions();
}