aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2014-02-11 00:17:27 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-10 14:33:44 -0800
commit4b21e2f9a30971e55c7d99d0f5d77dbdde76c075 (patch)
tree5f2140db3fd2cd2edba52c0bae917acd008f4682
parent691fbabb7aac6467df5db0b784220fd7c0b92214 (diff)
downloadsubsurface-4b21e2f9a30971e55c7d99d0f5d77dbdde76c075.tar.gz
Profile2: Prevent another crash if no dives are present
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/profile/diveplotdatamodel.cpp2
1 files changed, 2 insertions, 0 deletions
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);