diff --git a/src/kernel/save.c b/src/kernel/save.c index 511585dda..b3c38d686 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -1346,10 +1346,14 @@ void writefaction(struct gamedata *data, const faction * f) WRITE_SECTION(data->store); for (sf = f->allies; sf; sf = sf->next) { + int no; + int status; + assert(sf->faction); - int no = sf->faction->no; - int status = alliedfaction(NULL, f, sf->faction, HELP_ALL); + no = sf->faction->no; + status = alliedfaction(NULL, f, sf->faction, HELP_ALL); + if (status != 0) { WRITE_INT(data->store, no); WRITE_INT(data->store, sf->status);