QmlDesigner: crash fix

ModelNode::isComponent() is throwing an exception if the node is
not valid.

Change-Id: I4b34b9a583108923d584a73585f3001df68a741d
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Thomas Hartmann
2013-08-05 18:23:09 +02:00
parent 51b390cada
commit 4f8c4a8840

View File

@@ -99,7 +99,8 @@ bool selectionHasSameParent(const SelectionContext &selectionState)
bool selectionIsComponent(const SelectionContext &selectionState) bool selectionIsComponent(const SelectionContext &selectionState)
{ {
return selectionState.currentSingleSelectedNode().isComponent(); return selectionState.currentSingleSelectedNode().isValid()
&& selectionState.currentSingleSelectedNode().isComponent();
} }
} //SelectionStateFunctors } //SelectionStateFunctors