Module:Favilink: Difference between revisions

37 bytes added ,  10:47, 19 January 2023
Add additional condition to displayimage addition to prevent string.len error with nil
m (support "suffix:")
(Add additional condition to displayimage addition to prevent string.len error with nil)
Line 90: Line 90:


local img = displayimg
local img = displayimg
if string.len(displayimg) > 4 then
if displayimg ~= nil then
if string.sub(displayimg, -4) == '.png' then
if string.len(displayimg) > 4 then
    img = '[[File:' .. displayimg.. '|16px|link='..pagelink..']]'
if string.sub(displayimg, -4) == '.png' then
    img = '[[File:' .. displayimg.. '|16px|link='..pagelink..']]'
end
end
end
end
end