From c7f9ee691428fd5a8af8a9f007f1a4ef4393fb8e Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 1 Mar 2007 18:28:55 +0000 Subject: (svn r8955) -Fix: crash on loading savegames with GRFs that do not have their GRF info/name set. --- src/newgrf_config.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index 1fc53fe6a..ccd212055 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -255,8 +255,8 @@ compatible_grf: free(c->filename); c->filename = strdup(f->filename); memcpy(c->md5sum, f->md5sum, sizeof(c->md5sum)); - if (c->name == NULL) c->name = strdup(f->name); - if (c->info == NULL) c->info = strdup(f->info); + if (c->name == NULL && f->name != NULL) c->name = strdup(f->name); + if (c->info == NULL && f->info != NULL) c->info = strdup(f->info); c->error = NULL; } } -- cgit v1.2.3-70-g09d2