Commit d31b3dce authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.Navigator: Crash fix



Objects which are not an Item are not visible in the tree view.
In this case model() is 0 and Qt Creator was crashing when detaching
the navigator view.

Change-Id: I144c940d76157defb27133673ed911d733d8b5ef
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent 34fb3d6a
...@@ -548,8 +548,10 @@ static QList<QStandardItem*> takeWholeRow(const ItemRow &itemRow) ...@@ -548,8 +548,10 @@ static QList<QStandardItem*> takeWholeRow(const ItemRow &itemRow)
{ {
if (itemRow.idItem->parent()) if (itemRow.idItem->parent())
return itemRow.idItem->parent()->takeRow(itemRow.idItem->row()); return itemRow.idItem->parent()->takeRow(itemRow.idItem->row());
else else if (itemRow.idItem->model())
return itemRow.idItem->model()->takeRow(itemRow.idItem->row()); return itemRow.idItem->model()->takeRow(itemRow.idItem->row());
else
return itemRow.toList();
} }
void NavigatorTreeModel::removeSubTree(const ModelNode &node) void NavigatorTreeModel::removeSubTree(const ModelNode &node)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment