Don't crash when looping over pictures for a null dive

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-06-03 07:48:35 -07:00
parent 575a092e7e
commit 7651de361a

5
dive.h
View file

@ -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();