mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
Avoid potential crash if no dive is selected
I missed to spots where we would unconditionally dereference the dive pointer. Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Reported-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
df01a5d35f
commit
661aa67e89
1 changed files with 2 additions and 2 deletions
|
@ -91,8 +91,8 @@ void MainTab::updateDiveInfo(int dive)
|
|||
ui->rating->setCurrentStars(d->rating);
|
||||
else
|
||||
ui->rating->setCurrentStars(0);
|
||||
ui->maximumDepthText->setText(get_depth_string(d->maxdepth, TRUE));
|
||||
ui->averageDepthText->setText(get_depth_string(d->meandepth, TRUE));
|
||||
ui->maximumDepthText->setText(d ? get_depth_string(d->maxdepth, TRUE) : "");
|
||||
ui->averageDepthText->setText(d ? get_depth_string(d->meandepth, TRUE) : "");
|
||||
sacVal.mliter = d ? d->sac : 0;
|
||||
ui->sacText->setText(get_volume_string(sacVal, TRUE).append("/min"));
|
||||
ui->otuText->setText(QString("%1").arg( d ? d->otu : 0));
|
||||
|
|
Loading…
Add table
Reference in a new issue