Don't crash when saving game and pViewData is NULL.

Not sure if this is supposed to be able to happen, but it did.
master
Cyp 2012-10-09 09:55:00 +02:00
parent e5ec6df5a1
commit f81230483e
1 changed files with 1 additions and 1 deletions

View File

@ -6163,7 +6163,7 @@ static bool writeMessageFile(const char *pFileName)
else
{
VIEWDATA *pViewData = (VIEWDATA*)psMessage->pViewData;
ini.setValue("name", pViewData->pName);
ini.setValue("name", pViewData != NULL? pViewData->pName : "NULL");
}
ini.setValue("read", psMessage->read); // flag to indicate whether message has been read; not that this is/was _not_ read by loading code!?
ASSERT(player == psMessage->player, "Bad player number (%d == %d)", player, psMessage->player);