From 4f8c4a8840b62c253f3739d57b61e9d29d9fe1ea Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 5 Aug 2013 18:23:09 +0200 Subject: [PATCH] QmlDesigner: crash fix ModelNode::isComponent() is throwing an exception if the node is not valid. Change-Id: I4b34b9a583108923d584a73585f3001df68a741d Reviewed-by: Thomas Hartmann --- .../components/componentcore/modelnodecontextmenu_helper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp index 5e316a810f1..f05fb1db939 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp @@ -99,7 +99,8 @@ bool selectionHasSameParent(const SelectionContext &selectionState) bool selectionIsComponent(const SelectionContext &selectionState) { - return selectionState.currentSingleSelectedNode().isComponent(); + return selectionState.currentSingleSelectedNode().isValid() + && selectionState.currentSingleSelectedNode().isComponent(); } } //SelectionStateFunctors