summaryrefslogtreecommitdiffstats
path: root/statistics.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-03 07:50:30 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-03 07:50:30 -0800
commit3fab68dcd3689d795248dfc5bb0c98b72b424252 (patch)
treefa0496d3d0d98a7a806a86075808bda13d0475f1 /statistics.c
parent9eb55a0fc6b13dfd608009cac275bdbbbb71592c (diff)
downloadsubsurface-3fab68dcd3689d795248dfc5bb0c98b72b424252.tar.gz
Fix two more potential crashes for dives without samples
This should be all of them (famous last words). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'statistics.c')
-rw-r--r--statistics.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/statistics.c b/statistics.c
index 4023cdc85..17667f899 100644
--- a/statistics.c
+++ b/statistics.c
@@ -302,7 +302,7 @@ bool is_cylinder_used(struct dive *dive, int idx)
for_each_dc(dive, dc) {
struct event *event = get_next_event(dc->events, "gaschange");
while (event) {
- if (event->time.seconds == dc->sample[0].time.seconds)
+ if (dc->sample && event->time.seconds == dc->sample[0].time.seconds)
firstGasExplicit = true;
if (get_cylinder_index(dive, event) == idx)
return true;