From 522d9c8d73d58fd0a6cbdbdf97354e2648dc7eca Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 17 May 2015 22:32:35 -0400 Subject: [PATCH] Fix null dereference when loading schematic from definition without a NodeDefManager --- src/script/lua_api/l_mapgen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }