Skip to content

Commit

Permalink
[#82] Added null-check to SignalUpdatePacket
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielxs01 committed May 8, 2023
1 parent e1dbebc commit 4ff0144
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ protected void handle() {
if (0 == signalType) {
// Simple signal
TileSignalPart tile = getWorld().getBlockEntity(signalPos, TileSignalPart.class);
if(tile == null)
return;
tile.setState(state);
} else if (1 == signalType) {
// Complex signal
TileComplexSignal tile = getWorld().getBlockEntity(signalPos, TileComplexSignal.class);
if(tile == null)
return;
tile.setSignalGroupStates(signalGroupStates);
}
}
Expand Down

0 comments on commit 4ff0144

Please sign in to comment.