summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-03-01 18:28:55 +0000
committerrubidium <rubidium@openttd.org>2007-03-01 18:28:55 +0000
commitc7f9ee691428fd5a8af8a9f007f1a4ef4393fb8e (patch)
tree523e569d2a2ffdac13a59a8c182e7e44bd27dd41
parentdd403b586d779c9bf45b658323733c51508c235e (diff)
downloadopenttd-c7f9ee691428fd5a8af8a9f007f1a4ef4393fb8e.tar.xz
(svn r8955) -Fix: crash on loading savegames with GRFs that do not have their GRF info/name set.
-rw-r--r--src/newgrf_config.cpp4
1 files 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;
}
}