summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dive.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dive.c b/dive.c
index 683fbb836..4cb9672ed 100644
--- a/dive.c
+++ b/dive.c
@@ -2369,6 +2369,9 @@ int average_depth(struct diveplan *dive)
int last_depth = 0;
struct divedatapoint *dp = dive->dp;
+ if (!dp)
+ return 0;
+
while (dp) {
if (dp->time) {
/* Ignore gas indication samples */