aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/simplewidgets.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/desktop-widgets/simplewidgets.cpp b/desktop-widgets/simplewidgets.cpp
index 6eaab2eef..943da56c3 100644
--- a/desktop-widgets/simplewidgets.cpp
+++ b/desktop-widgets/simplewidgets.cpp
@@ -193,9 +193,11 @@ void ShiftTimesDialog::buttonClicked(QAbstractButton *button)
}
ui.timeEdit->setTime(QTime(0, 0, 0, 0));
- when = get_times(); //get time of first selected dive
- ui.currentTime->setText(get_dive_date_string(when));
- ui.shiftedTime->setText(get_dive_date_string(when));
+ dive *d = first_selected_dive();
+ if (d) {
+ ui.currentTime->setText(get_dive_date_string(d->when));
+ ui.shiftedTime->setText(get_dive_date_string(d->when));
+ }
}
void ShiftTimesDialog::changeTime()