Mercurial > hg > batmud > maputils
changeset 2612:268ac82d0305
Add NULL check for loc->file as it may not be set for new locations.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 16 Feb 2024 15:34:25 +0200 |
parents | 54dec981e678 |
children | baabecd9b6c8 |
files | src/mkloc.c |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/mkloc.c Fri Feb 16 15:33:29 2024 +0200 +++ b/src/mkloc.c Fri Feb 16 15:34:25 2024 +0200 @@ -678,9 +678,9 @@ if (first) { // Get continent name - char *csep, *continent = th_strdup( - (loc->file->continent != NULL) ? - loc->file->continent : loc->file->filename); + char *csep, *continent = loc->file != NULL ? + th_strdup((loc->file->continent != NULL) ? + loc->file->continent : loc->file->filename) : NULL; // Remove filename extension, if found if (continent != NULL &&