From b107ddadf590a1ac2403022b7b8919bcdb324def Mon Sep 17 00:00:00 2001 From: Philipp Dreher Date: Sun, 1 Nov 2015 21:43:18 +0100 Subject: [PATCH] added assert to check the faction-pointer --- src/kernel/save.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kernel/save.c b/src/kernel/save.c index 300555180..511585dda 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -1346,7 +1346,9 @@ void writefaction(struct gamedata *data, const faction * f) WRITE_SECTION(data->store); for (sf = f->allies; sf; sf = sf->next) { - int no = (sf->faction != NULL) ? sf->faction->no : 0; + assert(sf->faction); + + int no = sf->faction->no; int status = alliedfaction(NULL, f, sf->faction, HELP_ALL); if (status != 0) { WRITE_INT(data->store, no);