From d596d5312dd9300dc9eb21c4b19d9827553cb633 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 31 Dec 2024 02:39:02 +0300 Subject: [PATCH] fix(classes): Avoid assuming legacy script tags will return a table --- classes/base.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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