mirror of
https://github.com/filoghost/ChestCommands.git
synced 2025-02-17 03:51:29 +01:00
Fix NPE
This commit is contained in:
parent
9d7be71593
commit
267e53979f
@ -9,6 +9,7 @@ import com.gmail.filoghost.chestcommands.api.Icon;
|
||||
import com.gmail.filoghost.chestcommands.bridge.EconomyBridge;
|
||||
import com.gmail.filoghost.chestcommands.bridge.PlayerPointsBridge;
|
||||
import com.gmail.filoghost.chestcommands.internal.RequiredItem;
|
||||
import com.gmail.filoghost.chestcommands.util.StringUtils;
|
||||
import com.gmail.filoghost.chestcommands.util.Utils;
|
||||
|
||||
public class ExtendedIcon extends Icon {
|
||||
@ -41,7 +42,7 @@ public class ExtendedIcon extends Icon {
|
||||
}
|
||||
|
||||
public void setPermission(String permission) {
|
||||
if (permission.isEmpty()) {
|
||||
if (StringUtils.isNullOrEmpty(permission)) {
|
||||
permission = null;
|
||||
}
|
||||
|
||||
@ -75,7 +76,7 @@ public class ExtendedIcon extends Icon {
|
||||
}
|
||||
|
||||
public void setViewPermission(String viewPermission) {
|
||||
if (viewPermission.isEmpty()) {
|
||||
if (StringUtils.isNullOrEmpty(viewPermission)) {
|
||||
viewPermission = null;
|
||||
}
|
||||
|
||||
|
@ -81,4 +81,8 @@ public class StringUtils {
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
public static boolean isNullOrEmpty(String s) {
|
||||
return s == null || s.isEmpty();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user