diff --git a/classes/base.lua b/classes/base.lua index f51818b70..738180b9b 100644 --- a/classes/base.lua +++ b/classes/base.lua @@ -479,7 +479,7 @@ function class:registerCommands () local module = options.src:gsub("%/", ".") local original = (("\\script[src=%s]"):format(options.src)) local result = SILE.require(options.src) - local suggested = (result._name and "\\use[module=%s]" or "\\lua[require=%s]"):format(module) + local suggested = (type(result) == "table" and result._name and "\\use[module=%s]" or "\\lua[require=%s]"):format(module) _deprecated(original, suggested) return result else