forked from qt-creator/qt-creator
Scxml: Avoid potential nullptr access
Change-Id: Ib3bed9d6bd5f42adfd24aca2a935940d7de0ee38 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user