diff --git a/api.lua b/api.lua index 4c07c86..8fa8c11 100644 --- a/api.lua +++ b/api.lua @@ -39,6 +39,10 @@ end -- @return nil if node doesn't exists or nodename with mode prefix -- @see https://github.com/Uberi/Minetest-WorldEdit function x_marketplace.normalize_nodename(nodename) + if not nodename then + return false + end + nodename = nodename:gsub("^%s*(.-)%s*$", "%1") -- strip spaces if nodename == "" then return nil end