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>
This commit is contained in:
Lubomir I. Ivanov 2014-02-11 00:17:27 +02:00 committed by Dirk Hohndel
parent 691fbabb7a
commit 4b21e2f9a3

View file

@ -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);