Skip to content

Commit

Permalink
fix possible crash on getting mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ix0rai committed Aug 23, 2024
1 parent 29b3ded commit 0207f43
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/io/ix0rai/rainglow/config/PerWorldConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ public RainglowMode getMode(World world) {
}
}

if (mode == null) {
return RainglowMode.get(Rainglow.CONFIG.defaultMode.value());
} else {
return RainglowMode.get(mode);
if (mode != null) {
RainglowMode rainglowMode = RainglowMode.get(mode);
if (rainglowMode != null) {
return rainglowMode;
}
}

return RainglowMode.get(Rainglow.CONFIG.defaultMode.value());
}

public void setMode(World world, RainglowMode mode) {
Expand Down

0 comments on commit 0207f43

Please sign in to comment.