From e75f95115f245d0b049a01bbab446a0863d267f1 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 29 Nov 2016 14:04:19 +0100 Subject: [PATCH] Scxml: Avoid potential nullptr access Change-Id: Ib3bed9d6bd5f42adfd24aca2a935940d7de0ee38 Reviewed-by: Ulf Hermann --- src/plugins/scxmleditor/common/structuremodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/scxmleditor/common/structuremodel.cpp b/src/plugins/scxmleditor/common/structuremodel.cpp index a0ee760547a..f7b2e563e98 100644 --- a/src/plugins/scxmleditor/common/structuremodel.cpp +++ b/src/plugins/scxmleditor/common/structuremodel.cpp @@ -161,7 +161,7 @@ QModelIndex StructureModel::parent(const QModelIndex &index) const return QModelIndex(); const ScxmlTag *child = getItem(index); - if (child != m_document->rootTag()) { + if (child && child != m_document->rootTag()) { ScxmlTag *parentTag = child->parentTag(); if (parentTag) return createIndex(parentTag->index(), 0, parentTag);