Don't choke on failed node name parsing
This commit is contained in:
@ -11,7 +11,11 @@ end
|
||||
|
||||
local function setup(db)
|
||||
db:create_function("parse_node_name", 1, function(ctx, table_name)
|
||||
local obj = csexp.parse(table_name)
|
||||
local ok, obj = pcall(csexp.parse, table_name)
|
||||
if not ok then
|
||||
ctx:result_null()
|
||||
return
|
||||
end
|
||||
if type(obj) ~= "table" or obj[1] ~= "node" then
|
||||
ctx:result_null()
|
||||
return
|
||||
|
Reference in New Issue
Block a user