From 4b21e2f9a30971e55c7d99d0f5d77dbdde76c075 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Tue, 11 Feb 2014 00:17:27 +0200 Subject: Profile2: Prevent another crash if no dives are present Signed-off-by: Lubomir I. Ivanov Signed-off-by: Dirk Hohndel --- qt-ui/profile/diveplotdatamodel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp index 3c89e81e7..a754b0e79 100644 --- a/qt-ui/profile/diveplotdatamodel.cpp +++ b/qt-ui/profile/diveplotdatamodel.cpp @@ -147,6 +147,8 @@ void DivePlotDataModel::emitDataChanged() void DivePlotDataModel::calculateDecompression() { struct dive *d = getDiveById(id()); + if (!d) + return; struct divecomputer *dc = select_dc(&d->dc); init_decompression(d); calculate_deco_information(d, dc, &pInfo, FALSE); -- cgit v1.2.3-70-g09d2