diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
index 277eb33189c5281e9337d4e0448e2a1322ea4871..968602bafaa8c7829059e261a82ed39966e95969 100644
--- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
+++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
@@ -264,7 +264,7 @@ void StatesEditorView::nodeAboutToBeRemoved(const ModelNode &removedNode)
             m_lastIndex = propertyParent.indexOf(removedNode);
         }
     }
-    if (removedNode == currentState())
+    if (currentState().isValid() && removedNode == currentState())
         setCurrentState(baseState());
 }