# HG changeset patch # User truebrain # Date 2011-12-21 12:40:29 # Node ID b546d3612dd0492efef45a9d06efd079f0986189 # Parent e07f88e01903de33d149a661c6f484627f36e1ab (svn r23649) -Fix [FS#4905) (r23634): loading a savegame with an empty GSTR chunk caused assert diff --git a/src/saveload/game_sl.cpp b/src/saveload/game_sl.cpp --- a/src/saveload/game_sl.cpp +++ b/src/saveload/game_sl.cpp @@ -158,6 +158,13 @@ static void Load_GSTR() *_current_data->raw_strings.Append() = ls; } + /* If there were no strings in the savegame, set GameStrings to NULL */ + if (_current_data->raw_strings.Length() == 0) { + delete _current_data; + _current_data = NULL; + return; + } + _current_data->Compile(); ReconsiderGameScriptLanguage(); }