mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-26 16:39:45 +00:00
[GM] Catch all of the null.
This commit is contained in:
parent
1661eddc02
commit
20b9111495
1 changed files with 17 additions and 13 deletions
|
@ -823,25 +823,29 @@ public class WorldDataHolder {
|
||||||
* nothing.
|
* nothing.
|
||||||
*/
|
*/
|
||||||
} else {
|
} else {
|
||||||
|
try {
|
||||||
if (nodeData instanceof List) {
|
if (nodeData instanceof List) {
|
||||||
for (Object o : ((List) nodeData)) {
|
for (Object o : ((List) nodeData)) {
|
||||||
/*
|
/*
|
||||||
* Only add this permission if it's not empty
|
* Only add this permission if it's not empty
|
||||||
*/
|
*/
|
||||||
if (!o.toString().isEmpty())
|
if (!o.toString().isEmpty()) {
|
||||||
thisUser.addPermission(o.toString());
|
thisUser.addPermission(o.toString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (nodeData instanceof String) {
|
} else if (nodeData instanceof String) {
|
||||||
try {
|
|
||||||
/*
|
/*
|
||||||
* Only add this permission if it's not empty
|
* Only add this permission if it's not empty
|
||||||
*/
|
*/
|
||||||
if (!nodeData.toString().isEmpty())
|
if (!nodeData.toString().isEmpty()) {
|
||||||
thisUser.addPermission(nodeData.toString());
|
thisUser.addPermission(nodeData.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
// Ignore this entry as it's null.
|
// Ignore this entry as it's null.
|
||||||
}
|
}
|
||||||
}
|
|
||||||
thisUser.sortPermissions();
|
thisUser.sortPermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue