From 3024b2b83cb40bb694da08b7b51ec3112c130980 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 16 May 2013 15:09:45 -0600 Subject: Don't deleteLater a null pointer When the application launches, the oldModel is null. Signed-off-by: Thiago Macieira Signed-off-by: Dirk Hohndel --- qt-ui/divelistview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qt-ui') 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(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); -- cgit v1.2.3-70-g09d2