diff options
author | frosch <frosch@openttd.org> | 2012-09-02 10:04:28 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-09-02 10:04:28 +0000 |
commit | e84cf93c98a207cdd9cf0112c085f7f9c7d48ebf (patch) | |
tree | 936233ed46bd99b54b588a7d63ad099ba9dfafbd /src/network/core | |
parent | 4512a4f2257240653cd8d9ad0d7845be604e5443 (diff) | |
download | openttd-e84cf93c98a207cdd9cf0112c085f7f9c7d48ebf.tar.xz |
(svn r24508) -Fix [FS#5281] (24488): Content GUI crashed after downloading a NewGRF while it is selected.
Diffstat (limited to 'src/network/core')
-rw-r--r-- | src/network/core/tcp_content.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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; |