summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-18 19:23:41 +0000
committerrubidium <rubidium@openttd.org>2009-01-18 19:23:41 +0000
commita4865b0cab650dc33eee02ceba32ade3057e07a6 (patch)
tree14039f6621154870abc25878f2253a4916b39453 /src
parentcc97195a66f49e55e02c7830e8e6b56545ffdcc9 (diff)
downloadopenttd-a4865b0cab650dc33eee02ceba32ade3057e07a6.tar.xz
(svn r15142) -Fix (r15126): missing NewGRFs cause a crash when getting the content list.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_gui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index cb8bd89f1..d18ef00b6 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -600,7 +600,7 @@ struct NewGRFWindow : public Window {
ContentInfo *ci = new ContentInfo();
ci->type = CONTENT_TYPE_NEWGRF;
ci->state = ContentInfo::DOES_NOT_EXIST;
- ttd_strlcpy(ci->name, c->name, lengthof(ci->name));
+ ttd_strlcpy(ci->name, c->name != NULL ? c->name : c->filename, lengthof(ci->name));
ci->unique_id = BSWAP32(c->grfid);
memcpy(ci->md5sum, c->md5sum, sizeof(ci->md5sum));
*cv.Append() = ci;