Anonymous user
Module:Shortcut: Difference between revisions
allow output if no shortcuts are set but msg is present
(fix error message) |
(allow output if no shortcuts are set but msg is present) |
||
Line 17:
local nShortcuts = #shortcuts
-- Check that we have something to display
-- Validate shortcuts▼
if nShortcuts < 1 and not options.msg then
return nil
for i, shortcut in ipairs(shortcuts) do▼
▲ -- Validate shortcuts
error(string.format(▼
'at least one character in length)'▼
'shortcut #%d was invalid (shortcuts must be strings of ' ..
), 2)▼
▲ end
end
end
Line 82 ⟶ 83:
-- Error category
if shortcuts[1] then
local title = mw.title.new(shortcuts[1])
if not title or not title.exists then
|