From a9a207685a9d55e4fcdd97f5065383e2ec18e114 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Thu, 26 May 2022 22:28:33 +0200 Subject: Reject registering node with empty name fixes #10769 --- src/script/lua_api/l_item.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/script/lua_api') diff --git a/src/script/lua_api/l_item.cpp b/src/script/lua_api/l_item.cpp index b58b994d9..27c1b8875 100644 --- a/src/script/lua_api/l_item.cpp +++ b/src/script/lua_api/l_item.cpp @@ -594,6 +594,9 @@ int ModApiItemMod::l_register_item_raw(lua_State *L) // be done if (f.name == "ignore") return 0; + // This would break everything + if (f.name.empty()) + throw LuaError("Cannot register node with empty name"); content_t id = ndef->set(f.name, f); -- cgit v1.2.3