changeset 10808:ae8a77ec9409 draft

(svn r15142) -Fix (r15126): missing NewGRFs cause a crash when getting the content list.
author rubidium <rubidium@openttd.org>
date Sun, 18 Jan 2009 19:23:41 +0000
parents f37c4223e688
children 0b7a4eee5b46
files src/newgrf_gui.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -600,7 +600,7 @@
 						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;