mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
Fixed dive_set_geodata_from_picture segfault.
Segfault did appear when picture had some gps coordinates but there was no dive site assigned to the dive. Signed-off-by: Jan Darowski <jan.darowski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f724b7ebf9
commit
d45c2da81d
1 changed files with 1 additions and 1 deletions
2
dive.c
2
dive.c
|
@ -2951,7 +2951,7 @@ unsigned int dive_get_picture_count(struct dive *d)
|
|||
void dive_set_geodata_from_picture(struct dive *d, struct picture *pic)
|
||||
{
|
||||
struct dive_site *ds = get_dive_site_by_uuid(d->dive_site_uuid);
|
||||
if (!dive_site_has_gps_location(ds) && (pic->latitude.udeg || pic->longitude.udeg)) {
|
||||
if (ds && !dive_site_has_gps_location(ds) && (pic->latitude.udeg || pic->longitude.udeg)) {
|
||||
ds->latitude = pic->latitude;
|
||||
ds->longitude = pic->longitude;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue