summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/network/core/tcp_content.cpp6
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;