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 (!parentTag && document)
|
||||||
if (document)
|
parentTag = document->rootTag();
|
||||||
parentTag = document->rootTag();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Connect existing item
|
// Connect existing item
|
||||||
if (targetType == UnknownType) {
|
if (targetType == UnknownType) {
|
||||||
@@ -675,7 +673,8 @@ void TransitionItem::connectToTopItem(const QPointF &pos, TransitionPoint tp, It
|
|||||||
if (parentItem)
|
if (parentItem)
|
||||||
parentItem->updateUIProperties();
|
parentItem->updateUIProperties();
|
||||||
|
|
||||||
document->addTag(parentTag, newTag);
|
if (document)
|
||||||
|
document->addTag(parentTag, newTag);
|
||||||
|
|
||||||
setEndItem(newItem);
|
setEndItem(newItem);
|
||||||
setSelected(false);
|
setSelected(false);
|
||||||
|
Reference in New Issue
Block a user