Skip to content

Commit 6ecbf28

Browse files
committed
Check table name in insert() and show better error message
1 parent 7b2185f commit 6ecbf28

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/themepark.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,11 @@ end
336336
-- ---------------------------------------------------------------------------
337337
-- ---------------------------------------------------------------------------
338338
function themepark:get_table(table_name)
339-
return self.tables[table_name]
339+
local dbtable = self.tables[table_name]
340+
if not dbtable then
341+
error("Unknown table '" .. table_name .. "'", 2)
342+
end
343+
return dbtable
340344
end
341345

342346
function themepark:add_debug_info(attrs, tags, dbgdata)

0 commit comments

Comments
 (0)