Showing the changes to libraries/script-engine/src/ScriptsModel.cpp (1 of 1 file). Show all
Unified · Split
| @@ -85,6 +85,9 @@ QModelIndex ScriptsModel::index(int row, int column, const QModelIndex& parent) · 84 unmodified lines | |||
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | QModelIndex ScriptsModel::parent(const QModelIndex& child) const { | 87 | QModelIndex ScriptsModel::parent(const QModelIndex& child) const { |
| 88 | if (!child.isValid()) { | ||
| 89 | return QModelIndex(); | ||
| 90 | } | ||
| 88 | TreeNodeFolder* parent = (static_cast<TreeNodeBase*>(child.internalPointer()))->getParent(); | 91 | TreeNodeFolder* parent = (static_cast<TreeNodeBase*>(child.internalPointer()))->getParent(); |
| 89 | if (!parent) { | 92 | if (!parent) { |
| 90 | return QModelIndex(); | 93 | return QModelIndex(); |