From: kwolekr Date: Sun, 7 Apr 2013 05:50:20 +0000 (-0400) Subject: Fix crash on creating map with invalid mg_name X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=5961106f9ffd9e9a2bc23e4bd700f6ce07505c9a;p=zefram%2Fminetest%2Fminetest_engine.git Fix crash on creating map with invalid mg_name --- diff --git a/src/emerge.cpp b/src/emerge.cpp index 2a5e84f6..499aaf29 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -243,6 +243,8 @@ MapgenParams *EmergeManager::createMapgenParams(std::string mgname) { MapgenParams *EmergeManager::getParamsFromSettings(Settings *settings) { std::string mg_name = settings->get("mg_name"); MapgenParams *mgparams = createMapgenParams(mg_name); + if (!mgparams) + return NULL; mgparams->mg_name = mg_name; mgparams->seed = settings->getU64(settings == g_settings ? "fixed_map_seed" : "seed");