Fix null dereference when loading schematic from definition without a NodeDefManager
authorkwolekr <kwolekr@minetest.net>
Mon, 18 May 2015 02:32:35 +0000 (22:32 -0400)
committerkwolekr <kwolekr@minetest.net>
Mon, 18 May 2015 02:32:35 +0000 (22:32 -0400)
src/script/lua_api/l_mapgen.cpp

index dc3644e1cbe51de2d190ba0670e34193f63d4e03..76e94e97e7bbe56e781acd9a4440eda7f56748db 100644 (file)
@@ -215,7 +215,8 @@ Schematic *load_schematic_from_def(lua_State *L, int index,
                }
        }
 
-       ndef->pendNodeResolve(schem);
+       if (ndef)
+               ndef->pendNodeResolve(schem);
 
        return schem;
 }