mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix crash in DiveTripModel.
A left click in the treeview header leads to a call to createIndex which results in a null pointer dereference. Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
06d296a17d
commit
5105d6a333
1 changed files with 1 additions and 1 deletions
|
@ -650,7 +650,7 @@ QModelIndex DiveTripModel::parent(const QModelIndex& index) const
|
|||
TreeItemDT* childItem = static_cast<TreeItemDT*>(index.internalPointer());
|
||||
TreeItemDT* parentItem = childItem->parent;
|
||||
|
||||
if (parentItem == rootItem)
|
||||
if (parentItem == rootItem || !parentItem)
|
||||
return QModelIndex();
|
||||
|
||||
return createIndex(parentItem->row(), 0, parentItem);
|
||||
|
|
Loading…
Add table
Reference in a new issue