diff options
author | glerch <guido.lerch@gmail.com> | 2015-09-10 20:54:03 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-09-10 12:44:12 -0700 |
commit | 682e23775c93a00804f71131342ee52aeacc6337 (patch) | |
tree | 711b55337aed763cac2ea228bdadce5eb85ac4a5 | |
parent | dc02a7aa6db3ff4211bce42f48fcdc3722594322 (diff) | |
download | subsurface-682e23775c93a00804f71131342ee52aeacc6337.tar.gz |
Uemis downloader: bug fix in uemis set dive location
Assuring that ds isn't NULL, had a few cases
that made SubSurface crash. Have not investigated
the root cause but it's likely that it is related to
the Uemis specific code. Nevertheless, checking ds
non NULL is certainly not a bad thing to do.
Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | uemis.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -173,9 +173,11 @@ void uemis_set_divelocation(int divespot, char *text, double longitude, double l while (hp) { if (hp->divespot == divespot) { struct dive_site *ds = get_dive_site_by_uuid(hp->dive_site_uuid); - ds->name = strdup(text); - ds->longitude.udeg = round(longitude * 1000000); - ds->latitude.udeg = round(latitude * 1000000); + if (ds) { + ds->name = strdup(text); + ds->longitude.udeg = round(longitude * 1000000); + ds->latitude.udeg = round(latitude * 1000000); + } } hp = hp->next; } |