Module:Lua banner: Difference between revisions
Fix issue with nil |
m Fix syntax issue |
||
| Line 112: | Line 112: | ||
local moduleTitle = mw.title.new(module) | local moduleTitle = mw.title.new(module) | ||
local editLevel = moduleTitle.protectionLevels["edit"] | local editLevel = moduleTitle.protectionLevels["edit"] | ||
local moduleProt = 0 | |||
if editLevel == nil then moduleProt = 0 else | if editLevel == nil then moduleProt = 0 else | ||
moduleProt = moduleTitle and moduleTitle.protectionLevels["edit"][1] | |||
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end | if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end | ||
if moduleProt < currentProt then | if moduleProt < currentProt then | ||