From 7a1c70737858605a2811375aef64ffa7702b603c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 1 Apr 2018 23:18:22 +0200 Subject: [PATCH] scripts/check_site.lua: print proper error message for non-string keys in need_alphanumeric_key() --- scripts/check_site.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/check_site.lua b/scripts/check_site.lua index b5bcd5f2..b268e0b3 100644 --- a/scripts/check_site.lua +++ b/scripts/check_site.lua @@ -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