summaryrefslogtreecommitdiff
path: root/src
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
commitc8faa6bee2ea565d6422ee0e35e58fd5535e7ecb (patch)
tree523e569d2a2ffdac13a59a8c182e7e44bd27dd41 /src
parent05fe6d2362fe8a7b657c30629d6883dbb5660b29 (diff)
downloadopenttd-c8faa6bee2ea565d6422ee0e35e58fd5535e7ecb.tar.xz
(svn r8955) -Fix: crash on loading savegames with GRFs that do not have their GRF info/name set.
Diffstat (limited to 'src')
-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;
}
}