diff options
author | embeddedt <42941056+embeddedt@users.noreply.github.com> | 2022-12-26 18:50:18 -0500 |
---|---|---|
committer | embeddedt <42941056+embeddedt@users.noreply.github.com> | 2022-12-26 18:50:18 -0500 |
commit | d9550259c1995d21fc345c58f2e531fdecf75acd (patch) | |
tree | 81365fd0c0581b68e472b2e6c5278657f779b35e /spark-forge1710/src/main/java/me/lucko | |
parent | 077889c3f80c954ff97dc347f75da3b436e2ba38 (diff) | |
download | spark-d9550259c1995d21fc345c58f2e531fdecf75acd.tar.gz spark-d9550259c1995d21fc345c58f2e531fdecf75acd.tar.bz2 spark-d9550259c1995d21fc345c58f2e531fdecf75acd.zip |
Attempt to fix NPE when running profiler
Diffstat (limited to 'spark-forge1710/src/main/java/me/lucko')
-rw-r--r-- | spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java b/spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java index 3fde91e..db9f299 100644 --- a/spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java +++ b/spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java @@ -88,7 +88,15 @@ public class Forge1710ServerSparkPlugin extends Forge1710SparkPlugin { public boolean hasPermission(ICommandSender sender, String permission) { if (sender instanceof EntityPlayerMP) { EntityPlayerMP player = (EntityPlayerMP)sender; - return isOp(player) || player.mcServer.getServerOwner().equals(player.getGameProfile().getName()); + if(isOp(player)) + return true; + else { + String serverOwner = MinecraftServer.getServer().getServerOwner(); + if(player.getGameProfile().getName() != null && serverOwner != null) + return serverOwner.equals(player.getGameProfile().getName()); + else + return false; + } } else { return true; } |