Skip to content

Commit

Permalink
fix(classes): Avoid assuming legacy script tags will return a table
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Dec 30, 2024
1 parent a3de042 commit d596d53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d596d53

Please sign in to comment.