diff options
author | Thiago Macieira <thiago@macieira.org> | 2013-05-16 15:09:45 -0600 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-05-16 14:13:22 -0700 |
commit | 3024b2b83cb40bb694da08b7b51ec3112c130980 (patch) | |
tree | 8394f97e37a257dd536609fa7c066434de715943 /qt-ui | |
parent | 18e5155ba59f6abf74ce1ea952299df9d0a41d84 (diff) | |
download | subsurface-3024b2b83cb40bb694da08b7b51ec3112c130980.tar.gz |
Don't deleteLater a null pointer
When the application launches, the oldModel is null.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-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); |