Skip to content

Commit

Permalink
Fix NPE on weather change in a game world if the game has not starte…
Browse files Browse the repository at this point in the history
…d yet. See #538
  • Loading branch information
Sataniel98 committed Feb 17, 2019
1 parent b97bf7f commit 887e0c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/de/erethon/dungeonsxl/world/DWorldListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ public void onWeatherChange(WeatherChangeEvent event) {
event.setCancelled(true);
} else if (dWorld instanceof DGameWorld) {
Game game = Game.getByGameWorld((DGameWorld) dWorld);
if (game == null || game.getRules() == null) {
return;
}
Boolean raining = game.getRules().isRaining();
if (raining == null) {
return;
Expand Down

0 comments on commit 887e0c9

Please sign in to comment.