Commit 6e612fc470069053fe1b6c950b3bf56f99c1f0f5
1 parent
be0307cb
add null checks for client permissions manager
Showing
1 changed file
with
16 additions
and
7 deletions
java/common/com/mumfrey/liteloader/core/LiteLoader.java
@@ -840,7 +840,10 @@ public final class LiteLoader | @@ -840,7 +840,10 @@ public final class LiteLoader | ||
840 | void onPostInitMod(LiteMod mod) | 840 | void onPostInitMod(LiteMod mod) |
841 | { | 841 | { |
842 | // add mod to permissions manager if permissible | 842 | // add mod to permissions manager if permissible |
843 | - this.permissionsManagerClient.registerMod(mod); | 843 | + if (this.permissionsManagerClient != null) |
844 | + { | ||
845 | + this.permissionsManagerClient.registerMod(mod); | ||
846 | + } | ||
844 | } | 847 | } |
845 | 848 | ||
846 | /** | 849 | /** |
@@ -872,7 +875,10 @@ public final class LiteLoader | @@ -872,7 +875,10 @@ public final class LiteLoader | ||
872 | */ | 875 | */ |
873 | void onJoinGame(INetHandler netHandler, S01PacketJoinGame loginPacket) | 876 | void onJoinGame(INetHandler netHandler, S01PacketJoinGame loginPacket) |
874 | { | 877 | { |
875 | - this.permissionsManagerClient.onJoinGame(netHandler, loginPacket); | 878 | + if (this.permissionsManagerClient != null) |
879 | + { | ||
880 | + this.permissionsManagerClient.onJoinGame(netHandler, loginPacket); | ||
881 | + } | ||
876 | 882 | ||
877 | this.coreProviders.all().onJoinGame(netHandler, loginPacket); | 883 | this.coreProviders.all().onJoinGame(netHandler, loginPacket); |
878 | } | 884 | } |
@@ -884,7 +890,7 @@ public final class LiteLoader | @@ -884,7 +890,7 @@ public final class LiteLoader | ||
884 | */ | 890 | */ |
885 | void onWorldChanged(World world) | 891 | void onWorldChanged(World world) |
886 | { | 892 | { |
887 | - if (world != null) | 893 | + if (world != null && this.permissionsManagerClient != null) |
888 | { | 894 | { |
889 | // For bungeecord | 895 | // For bungeecord |
890 | this.permissionsManagerClient.scheduleRefresh(); | 896 | this.permissionsManagerClient.scheduleRefresh(); |
@@ -915,13 +921,16 @@ public final class LiteLoader | @@ -915,13 +921,16 @@ public final class LiteLoader | ||
915 | if (clock) | 921 | if (clock) |
916 | { | 922 | { |
917 | // Tick the permissions manager | 923 | // Tick the permissions manager |
918 | - this.profiler.startSection("permissionsmanager"); | ||
919 | - this.permissionsManagerClient.onTick(this.engine, partialTicks, inGame); | 924 | + if (this.permissionsManagerClient != null) |
925 | + { | ||
926 | + this.profiler.startSection("permissionsmanager"); | ||
927 | + this.permissionsManagerClient.onTick(this.engine, partialTicks, inGame); | ||
928 | + this.profiler.endSection(); | ||
929 | + } | ||
920 | 930 | ||
921 | // Tick the config manager | 931 | // Tick the config manager |
922 | - this.profiler.endStartSection("configmanager"); | 932 | + this.profiler.startSection("configmanager"); |
923 | this.configManager.onTick(); | 933 | this.configManager.onTick(); |
924 | - | ||
925 | this.profiler.endSection(); | 934 | this.profiler.endSection(); |
926 | 935 | ||
927 | if (!this.engine.isRunning()) | 936 | if (!this.engine.isRunning()) |