Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lua/wikis/commons/TeamTemplate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ end
--[[
Same as TeamTemplate.getRaw, except that it returns nil if the team template
does not exist.

Throws if `team` is `nil`.
]]
---@param team string
---@param date string|number?
---@return teamTemplateData?
function TeamTemplate.getRawOrNil(team, date)
if Logic.isEmpty(team) then
return
end
assert(team ~= nil, 'TeamTemplate.getRawOrNil: \'team\' must not be nil')
team = team:gsub('_', ' '):lower()
Comment on lines -91 to 94

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

team:gsub throws if team is nil in the current implementation anyway

But that's not fully true? Since there's an early return if it's nil through the Logic Check?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's adjusted behavior from #6624
pr description was true until #6624 was merged

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it still work doing then?


-- return mw.ext.TeamTemplate.raw(team, date)
Expand Down
Loading