Fix NPE in WiredHandler

This commit is contained in:
Alejandro 2020-02-01 20:32:29 +02:00
parent add7156b9a
commit 44de2a81ec

View File

@ -415,10 +415,12 @@ public class WiredHandler {
}
public static void resetTimers(Room room) {
if (!room.isLoaded())
if (!room.isLoaded() || room.getRoomSpecialTypes() == null)
return;
room.getRoomSpecialTypes().getTriggers().forEach(t -> {
if (t == null) return;
if (t.getType() == WiredTriggerType.AT_GIVEN_TIME || t.getType() == WiredTriggerType.PERIODICALLY || t.getType() == WiredTriggerType.PERIODICALLY_LONG) {
((WiredTriggerReset) t).resetTimer();
}