From a46245f21f1f81709e3d093c6fcbca213c207e43 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 18 Jan 2009 19:23:41 +0000 Subject: [PATCH] (svn r15142) -Fix (r15126): missing NewGRFs cause a crash when getting the content list. --- src/newgrf_gui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index cb8bd89f1c..d18ef00b6b 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;