From 92ffd9cd79bb63c41cc81ec580ec331bec345456 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 2 Jan 2013 21:12:58 +0100 Subject: [PATCH] Treat a null state as a failed state. --- src/main/java/net/pterodactylus/reactor/engine/Engine.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/net/pterodactylus/reactor/engine/Engine.java b/src/main/java/net/pterodactylus/reactor/engine/Engine.java index a8c9f4e..949ce12 100644 --- a/src/main/java/net/pterodactylus/reactor/engine/Engine.java +++ b/src/main/java/net/pterodactylus/reactor/engine/Engine.java @@ -27,6 +27,7 @@ import net.pterodactylus.reactor.Query; import net.pterodactylus.reactor.Reaction; import net.pterodactylus.reactor.Trigger; import net.pterodactylus.reactor.states.AbstractState; +import net.pterodactylus.reactor.states.FailedState; import org.apache.log4j.Logger; @@ -122,6 +123,9 @@ public class Engine extends AbstractExecutionThreadService { try { logger.debug("Querying system..."); state = query.state(); + if (state == null) { + state = FailedState.INSTANCE; + } logger.debug("System queried."); } catch (Throwable t1) { logger.warn("Querying system failed!", t1); -- 2.7.4