From: David ‘Bombe’ Roden Date: Wed, 2 Jan 2013 20:12:58 +0000 (+0100) Subject: Treat a null state as a failed state. X-Git-Tag: 0.1~95 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=92ffd9cd79bb63c41cc81ec580ec331bec345456;p=rhynodge.git Treat a null state as a failed state. --- 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);