Skip to content
Snippets Groups Projects
Unverified Commit b7be32d9 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

scripts/check_site.lua: print proper error message for non-string keys in need_alphanumeric_key()

parent 951b6632
No related branches found
No related tags found
No related merge requests found
......@@ -217,8 +217,8 @@ end
function need_alphanumeric_key(path)
local val = path[#path]
-- We don't use character classes like %w here to be independent of the locale
if not val:match('^[0-9a-zA-Z_]+$') then
var_error(path, val, 'have a key using only alphanumeric characters and underscores')
if type(val) ~= 'string' or not val:match('^[0-9a-zA-Z_]+$') then
var_error(path, val, 'have a string key using only alphanumeric characters and underscores')
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment