aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Tim Segers <tsegers@pm.me>2021-10-11 18:53:52 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2021-10-11 20:53:41 +0300
commitb618d932413b3226faa7f29f719a1cabf2bc5bf9 (patch)
treefebb7afc8fbcd68435423d47c678b9c2e88130d0 /desktop-widgets
parentf3a02d70495bf502ca4fe157dc046c096483fa04 (diff)
downloadsubsurface-b618d932413b3226faa7f29f719a1cabf2bc5bf9.tar.gz
desktop: fix div-by-zero when selecting multiple invalid divesHEADmaster
Signed-off-by: Tim Segers <tsegers@pm.me>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/tab-widgets/TabDiveStatistics.cpp2
1 files changed, 1 insertions, 1 deletions
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));