From e84cf93c98a207cdd9cf0112c085f7f9c7d48ebf Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 2 Sep 2012 10:04:28 +0000 Subject: (svn r24508) -Fix [FS#5281] (24488): Content GUI crashed after downloading a NewGRF while it is selected. --- src/network/core/tcp_content.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/network') diff --git a/src/network/core/tcp_content.cpp b/src/network/core/tcp_content.cpp index f780798b0..24a7cce10 100644 --- a/src/network/core/tcp_content.cpp +++ b/src/network/core/tcp_content.cpp @@ -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; -- cgit v1.2.3-54-g00ecf