diff --git a/polymer/eduke32/build/src/defs.c b/polymer/eduke32/build/src/defs.c index 9f92d4acc..e056df7d2 100644 --- a/polymer/eduke32/build/src/defs.c +++ b/polymer/eduke32/build/src/defs.c @@ -3491,7 +3491,8 @@ int32_t loaddefinitionsfile(const char *fn) DO_FREE_AND_NULL(faketilebuffer); faketilebuffersiz = 0; - qsort(usermaphacks, num_usermaphacks, sizeof(usermaphack_t), compare_usermaphacks); + if (usermaphacks != NULL) + qsort(usermaphacks, num_usermaphacks, sizeof(usermaphack_t), compare_usermaphacks); if (!script) return -1; diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 1e9a50975..121e15b91 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -1711,7 +1711,7 @@ static void G_LoadMapHack(char *outbuf, const char *filename) append_ext_UNSAFE(outbuf, ".mhk"); - if (G_TryMapHack(outbuf)) + if (G_TryMapHack(outbuf) && usermaphacks != NULL) { usermaphack_t *pMapInfo = (usermaphack_t*)bsearch( &g_loadedMapHack, usermaphacks, num_usermaphacks, sizeof(usermaphack_t),