diff options
author | sfan5 <sfan5@live.de> | 2022-05-26 22:28:33 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2022-05-29 14:00:19 +0200 |
commit | a9a207685a9d55e4fcdd97f5065383e2ec18e114 (patch) | |
tree | 1ac4a29ddc45c97fe8c32c2c7fe2b360715482eb | |
parent | c1d03695d4859ff4a531c31b6bddcd8f50384c41 (diff) | |
download | minetest-a9a207685a9d55e4fcdd97f5065383e2ec18e114.tar.gz minetest-a9a207685a9d55e4fcdd97f5065383e2ec18e114.tar.bz2 minetest-a9a207685a9d55e4fcdd97f5065383e2ec18e114.zip |
Reject registering node with empty name
fixes #10769
-rw-r--r-- | src/script/lua_api/l_item.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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); |