forked from qt-creator/qt-creator
Scxml: Avoid possible nullptr dereference
Change-Id: Ie70da61f1c4f05d9247eb8b729fadad59b85cc45 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -621,10 +621,8 @@ void TransitionItem::connectToTopItem(const QPointF &pos, TransitionPoint tp, It
|
||||
}
|
||||
}
|
||||
|
||||
if (!parentTag) {
|
||||
if (document)
|
||||
parentTag = document->rootTag();
|
||||
}
|
||||
if (!parentTag && document)
|
||||
parentTag = document->rootTag();
|
||||
|
||||
// Connect existing item
|
||||
if (targetType == UnknownType) {
|
||||
@@ -675,7 +673,8 @@ void TransitionItem::connectToTopItem(const QPointF &pos, TransitionPoint tp, It
|
||||
if (parentItem)
|
||||
parentItem->updateUIProperties();
|
||||
|
||||
document->addTag(parentTag, newTag);
|
||||
if (document)
|
||||
document->addTag(parentTag, newTag);
|
||||
|
||||
setEndItem(newItem);
|
||||
setSelected(false);
|
||||
|
Reference in New Issue
Block a user