Scxml: Avoid possible nullptr dereference

Change-Id: Ie70da61f1c4f05d9247eb8b729fadad59b85cc45
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Tobias Hunger
2016-11-29 14:25:20 +01:00
parent e75f95115f
commit e2fb126509

View File

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