summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2015-06-07 07:55:53 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-07 08:04:37 -0700
commitdd5e221388f46dacbceaed1070bb28950e55405c (patch)
tree5eb4a4322bb6b237cb9a9458ad5bcc69de79cda9 /dive.h
parented20b004a88d6076a531a7c816cfaceae04002b0 (diff)
downloadsubsurface-dd5e221388f46dacbceaed1070bb28950e55405c.tar.gz
Temporary dive + temporary site = crash
We always thought that a dive had a dive site and that a dive really exists. but if we go to add dive and then go to add dive site, none of those exist yet and then we got a crash. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index 9a26892e6..8e54c3d73 100644
--- a/dive.h
+++ b/dive.h
@@ -624,6 +624,8 @@ static inline bool dive_site_has_gps_location(struct dive_site *ds)
static inline int dive_has_gps_location(struct dive *dive)
{
+ if (!dive)
+ return false;
return dive_site_has_gps_location(get_dive_site_by_uuid(dive->dive_site_uuid));
}