Commit ad238ed3 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner: crash fix

If the root node is invalid currentState is also invalid.

Change-Id: Icf47c9295cdf82bf7b36328e76dbb1a974ee43f9
Reviewed-on: http://codereview.qt.nokia.com/1706


Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent 0173ecbc
......@@ -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());
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment