Don’t trigger if state was not successful.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 3 Jan 2013 08:29:00 +0000 (09:29 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 3 Jan 2013 08:29:00 +0000 (09:29 +0100)
src/main/java/net/pterodactylus/reactor/engine/Engine.java

index 6454419..4ba7887 100644 (file)
@@ -150,7 +150,7 @@ public class Engine extends AbstractExecutionThreadService {
                        /* only run trigger if we have collected two states. */
                        Trigger trigger = nextReaction.trigger();
                        boolean triggerHit = false;
-                       if (reactionExecution.previousState() != null) {
+                       if ((reactionExecution.previousState() != null) && state.success()) {
                                logger.debug("Checking Trigger for changes...");
                                triggerHit = trigger.triggers(reactionExecution.currentState(), reactionExecution.previousState());
                        }