Skip to content

Commit

Permalink
Fix bugs in AoE Infobox Map (#3352)
Browse files Browse the repository at this point in the history
* Fix missing override for addToLpdb

* Catch empty string
  • Loading branch information
mbergen authored Oct 4, 2023
1 parent ee1201d commit 1bf9321
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/infobox/wikis/ageofempires/infobox_map_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ local Class = require('Module:Class')
local Game = require('Module:Game')
local Lua = require('Module:Lua')
local Page = require('Module:Page')
local String = require('Module:StringUtils')

local Injector = Lua.import('Module:Infobox/Widget/Injector', {requireDevIfEnabled = true})
local Map = Lua.import('Module:Infobox/Map', {requireDevIfEnabled = true})
Expand All @@ -34,6 +35,7 @@ local _args
function CustomMap.run(frame)
local customMap = Map(frame)
customMap.createWidgetInjector = CustomMap.createWidgetInjector
customMap.addToLpdb = CustomMap.addToLpdb
customMap.getWikiCategories = CustomMap.getWikiCategories
_args = customMap.args
_args.releasedate = _args.date
Expand Down Expand Up @@ -68,7 +70,7 @@ end

function CustomMap:addToLpdb(lpdbData, args)
lpdbData.extradata = {
creator = mw.ext.TeamLiquidIntegration.resolve_redirect(args.creator),
creator = String.isNotEmpty(args.creator) and mw.ext.TeamLiquidIntegration.resolve_redirect(args.creator) or nil,
spawns = args.players,
maptype = CustomMap:getType(args.type),
icon = args.icon,
Expand Down

0 comments on commit 1bf9321

Please sign in to comment.