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 | 840 | void onPostInitMod(LiteMod mod) |
841 | 841 | { |
842 | 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 | 875 | */ |
873 | 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 | 883 | this.coreProviders.all().onJoinGame(netHandler, loginPacket); |
878 | 884 | } |
... | ... | @@ -884,7 +890,7 @@ public final class LiteLoader |
884 | 890 | */ |
885 | 891 | void onWorldChanged(World world) |
886 | 892 | { |
887 | - if (world != null) | |
893 | + if (world != null && this.permissionsManagerClient != null) | |
888 | 894 | { |
889 | 895 | // For bungeecord |
890 | 896 | this.permissionsManagerClient.scheduleRefresh(); |
... | ... | @@ -915,13 +921,16 @@ public final class LiteLoader |
915 | 921 | if (clock) |
916 | 922 | { |
917 | 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 | 931 | // Tick the config manager |
922 | - this.profiler.endStartSection("configmanager"); | |
932 | + this.profiler.startSection("configmanager"); | |
923 | 933 | this.configManager.onTick(); |
924 | - | |
925 | 934 | this.profiler.endSection(); |
926 | 935 | |
927 | 936 | if (!this.engine.isRunning()) | ... | ... |