basename error handling

This commit is contained in:
VorTechnix 2021-02-24 09:19:08 -08:00
parent 191f1385b1
commit 1d93122801

@ -8,7 +8,9 @@ worldedit.register_command("basename", {
description = "Returns the base name of nodes that use a given alias.", description = "Returns the base name of nodes that use a given alias.",
privs = {worldedit = true}, privs = {worldedit = true},
parse = function(params_text) parse = function(params_text)
params_text = params_text or "air" if params_text == "" or not params_text then
return false, "Node not specified."
end
return true, params_text return true, params_text
end, end,
func = function(name, params_text) func = function(name, params_text)