mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Don't crash when looping over pictures for a null dive
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
575a092e7e
commit
7651de361a
1 changed files with 3 additions and 2 deletions
5
dive.h
5
dive.h
|
@ -291,8 +291,9 @@ struct picture {
|
|||
struct picture *next;
|
||||
};
|
||||
|
||||
#define FOR_EACH_PICTURE( DIVE ) \
|
||||
for(struct picture *picture = DIVE->picture_list; picture; picture = picture->next)
|
||||
#define FOR_EACH_PICTURE(_dive) \
|
||||
if (_dive) \
|
||||
for (struct picture *picture = (_dive)->picture_list; picture; picture = picture->next)
|
||||
|
||||
|
||||
extern struct picture *alloc_picture();
|
||||
|
|
Loading…
Add table
Reference in a new issue