diff options
author | syeyoung <cyoung06@naver.com> | 2023-02-27 02:11:24 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2023-02-27 02:11:24 +0900 |
commit | 1090e0039d041ea932c7716fc572eb86cbc47d86 (patch) | |
tree | 1a60037d21a66ce7c2f81a5f571f4479ad492173 | |
parent | b86f521aec51783d9bcf5fb153bce851f9e4536a (diff) | |
download | Skyblock-Dungeons-Guide-1090e0039d041ea932c7716fc572eb86cbc47d86.tar.gz Skyblock-Dungeons-Guide-1090e0039d041ea932c7716fc572eb86cbc47d86.tar.bz2 Skyblock-Dungeons-Guide-1090e0039d041ea932c7716fc572eb86cbc47d86.zip |
- Fix NPE due to incomplete dungeoncontext check
Signed-off-by: syeyoung <cyoung06@naver.com>
-rw-r--r-- | mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java index e0efd82c..5c6d32d0 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java @@ -72,6 +72,7 @@ public class FeatureDungeonSecrets extends TextHUDFeature { public int getTotalSecretsInt() { if (getSecretsFound() != 0) return (int) Math.ceil (getSecretsFound() / getSecretPercentage() * 100); DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + if (context == null) return 0; int totalSecrets = 0; if (context.getScaffoldParser() == null) return 0; for (DungeonRoom dungeonRoom : context.getScaffoldParser().getDungeonRoomList()) { @@ -110,7 +111,7 @@ public class FeatureDungeonSecrets extends TextHUDFeature { @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon(); + return DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null; } @Override |