Fixes a potential crash when adding new maps (#5422)

* Fixes a potential crash when adding new maps
* Fixes #5396.
* Fixes a potential crash on start up when adding a map to maps_athena.conf and the map has not yet been added to map_cache.dat.
Thanks to @nubspixel!

* Inverts check
This commit is contained in:
Aleos 2020-11-29 22:01:17 -05:00 committed by GitHub
parent f74915193d
commit 9eeeb09ff6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3559,6 +3559,9 @@ int map_readfromcache(struct map_data *m, char *buffer, char *decode_buffer)
for(i = 0; i < header->map_count; i++) {
info = (struct map_cache_map_info *)p;
// name exists in maps_athena.conf but not in map_cache.dat
if (info->name == nullptr || info->name[0] == '\0')
continue;
if( strcmp(m->name, info->name) == 0 )
break; // Map found