Jump to content

Module:Lua banner: Difference between revisions

no edit summary
m (1 revision imported)
No edit summary
Line 105: Line 105:
if titleObj.id ~= 0 then
if titleObj.id ~= 0 then
-- id is 0 (page does not exist) if am previewing before creating a template.
-- id is 0 (page does not exist) if am previewing before creating a template.
currentProt = titleObj.protectionLevels["edit"][1]
currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
end
end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end