Skip to content
Browse files

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

Not sure if this is supposed to be able to happen, but it did.
  • Loading branch information...
1 parent e5ec6df commit f81230483e419074a7309990767b6dab35a30567 @Cyp Cyp committed Oct 9, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/game.cpp
2 src/game.cpp
@@ -6163,7 +6163,7 @@ static bool writeMessageFile(const char *pFileName)
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);

0 comments on commit f812304

Please sign in to comment.
Something went wrong with that request. Please try again.