mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2025-02-17 21:02:12 +01:00
Fix game == null NPEs; resolves #538
This commit is contained in:
parent
8c117c8e2b
commit
fae084795a
@ -165,6 +165,9 @@ public class DWorldListener implements Listener {
|
||||
return;
|
||||
}
|
||||
Game game = Game.getByGameWorld(gameWorld);
|
||||
if (game == null) {
|
||||
return;
|
||||
}
|
||||
Set<ExMob> prot = interact ? game.getRules().getInteractionProtectedEntities() : game.getRules().getDamageProtectedEntities();
|
||||
if (prot.contains(caliburn.getExMob(entity))) {
|
||||
event.setCancelled(true);
|
||||
@ -187,7 +190,7 @@ public class DWorldListener implements Listener {
|
||||
event.setCancelled(true);
|
||||
} else if (dWorld instanceof DGameWorld) {
|
||||
Game game = Game.getByGameWorld((DGameWorld) dWorld);
|
||||
if (game == null || game.getRules() == null) {
|
||||
if (game == null) {
|
||||
return;
|
||||
}
|
||||
Boolean raining = game.getRules().isRaining();
|
||||
|
Loading…
Reference in New Issue
Block a user