diff options
-rw-r--r-- | qt-ui/divelistview.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index bed0599b0..5c8a93ff0 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -26,7 +26,8 @@ void DiveListView::reload() { QSortFilterProxyModel *m = qobject_cast<QSortFilterProxyModel*>(model()); QAbstractItemModel *oldModel = m->sourceModel(); - oldModel->deleteLater(); + if (oldModel) + oldModel->deleteLater(); m->setSourceModel(new DiveTripModel(this)); sortByColumn(0, Qt::DescendingOrder); QModelIndex firstDiveOrTrip = m->index(0,0); |