diff --git a/core/modules/workflows/src/Plugin/WorkflowTypeBase.php b/core/modules/workflows/src/Plugin/WorkflowTypeBase.php
index 0c4a34f..5324154 100644
--- a/core/modules/workflows/src/Plugin/WorkflowTypeBase.php
+++ b/core/modules/workflows/src/Plugin/WorkflowTypeBase.php
@@ -229,15 +229,20 @@ public function deleteState($state_id) {
     }
 
     foreach ($this->configuration['transitions'] as $transition_id => $transition) {
+      if ($transition['to'] === $state_id) {
+        $this->deleteTransition($transition_id);
+        continue;
+      }
       $from_key = array_search($state_id, $transition['from'], TRUE);
       if ($from_key !== FALSE) {
         // Remove state from the from array.
         unset($transition['from'][$from_key]);
-      }
-      if (empty($transition['from']) || $transition['to'] === $state_id) {
-        $this->deleteTransition($transition_id);
-      }
-      elseif ($from_key !== FALSE) {
+        if (empty($transition['from'])) {
+          // There are no more 'from' entries, remove the transition.
+          $this->deleteTransition($transition_id);
+          continue;
+        }
+        // We changed the from state, update the transition.
         $this->setTransitionFromStates($transition_id, $transition['from']);
       }
     }
