diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp index dc3644e1c..76e94e97e 100644 --- a/src/script/lua_api/l_mapgen.cpp +++ b/src/script/lua_api/l_mapgen.cpp @@ -215,7 +215,8 @@ Schematic *load_schematic_from_def(lua_State *L, int index, } } - ndef->pendNodeResolve(schem); + if (ndef) + ndef->pendNodeResolve(schem); return schem; }