From b618d932413b3226faa7f29f719a1cabf2bc5bf9 Mon Sep 17 00:00:00 2001 From: Tim Segers Date: Mon, 11 Oct 2021 18:53:52 +0200 Subject: desktop: fix div-by-zero when selecting multiple invalid dives Signed-off-by: Tim Segers --- desktop-widgets/tab-widgets/TabDiveStatistics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/tab-widgets/TabDiveStatistics.cpp b/desktop-widgets/tab-widgets/TabDiveStatistics.cpp index da0587802..c161ca6ab 100644 --- a/desktop-widgets/tab-widgets/TabDiveStatistics.cpp +++ b/desktop-widgets/tab-widgets/TabDiveStatistics.cpp @@ -75,7 +75,7 @@ void TabDiveStatistics::updateData() stats_t stats_selection; calculate_stats_selected(&stats_selection); clear(); - if (amount_selected > 1) { + if (amount_selected > 1 && stats_selection.selection_size >= 1) { ui->depthLimits->setMaximum(get_depth_string(stats_selection.max_depth, true)); ui->depthLimits->setMinimum(get_depth_string(stats_selection.min_depth, true)); ui->depthLimits->setAverage(get_depth_string(stats_selection.combined_max_depth.mm / stats_selection.selection_size, true)); -- cgit v1.2.3-70-g09d2