(svn r24508) -Fix [FS#5281] (24488): Content GUI crashed after downloading a NewGRF while it is selected.

This commit is contained in:
frosch 2012-09-02 10:04:28 +00:00
parent 4512a4f225
commit e84cf93c98
1 changed files with 4 additions and 2 deletions

View File

@ -116,9 +116,11 @@ const char *ContentInfo::GetTextfile(TextfileType type) const
case CONTENT_TYPE_GAME_LIBRARY:
tmp = Game::GetScannerLibrary()->FindMainScript(this, true);
break;
case CONTENT_TYPE_NEWGRF:
tmp = FindGRFConfig(BSWAP32(this->unique_id), FGCM_EXACT, this->md5sum)->filename;
case CONTENT_TYPE_NEWGRF: {
const GRFConfig *gc = FindGRFConfig(BSWAP32(this->unique_id), FGCM_EXACT, this->md5sum);
tmp = gc != NULL ? gc->filename : NULL;
break;
}
case CONTENT_TYPE_BASE_GRAPHICS:
tmp = TryGetBaseSetFile(this, true, BaseGraphics::GetAvailableSets());
break;