mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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;
|
struct picture *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define FOR_EACH_PICTURE( DIVE ) \
|
#define FOR_EACH_PICTURE(_dive) \
|
||||||
for(struct picture *picture = DIVE->picture_list; picture; picture = picture->next)
|
if (_dive) \
|
||||||
|
for (struct picture *picture = (_dive)->picture_list; picture; picture = picture->next)
|
||||||
|
|
||||||
|
|
||||||
extern struct picture *alloc_picture();
|
extern struct picture *alloc_picture();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue