mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
Fix crash when closing the data file
Only dereference the dive pointer if there actually is a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
21b7ebbaf0
commit
765e5b76e6
1 changed files with 1 additions and 1 deletions
|
@ -241,11 +241,11 @@ void MainTab::updateDiveInfo(int dive)
|
|||
UPDATE_TEXT(d, buddy);
|
||||
UPDATE_TEMP(d, airtemp);
|
||||
UPDATE_TEMP(d, watertemp);
|
||||
ui->dateTimeEdit->setDateTime(QDateTime::fromTime_t(d->when - gettimezoneoffset()));
|
||||
if (d) {
|
||||
char buffer[256];
|
||||
print_gps_coordinates(buffer, sizeof buffer, d->latitude.udeg, d->longitude.udeg);
|
||||
ui->coordinates->setText(buffer);
|
||||
ui->dateTimeEdit->setDateTime(QDateTime::fromTime_t(d->when - gettimezoneoffset()));
|
||||
if (mainWindow() && mainWindow()->dive_list()->selectedTrips.count() == 1) {
|
||||
// only use trip relevant fields
|
||||
ui->coordinates->setVisible(false);
|
||||
|
|
Loading…
Reference in a new issue