Scxml: Avoid potential nullptr access

Change-Id: Ib3bed9d6bd5f42adfd24aca2a935940d7de0ee38
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Tobias Hunger
2016-11-29 14:04:19 +01:00
parent 8d3a992f26
commit e75f95115f

View File

@@ -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);