Skip to content

Commit 09e2b6e

Browse files
committed
Added a small guard for a divide by 0 bug
1 parent 09c9e00 commit 09e2b6e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

widgets/ContainerFrame.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,7 @@ function containerProto:ResizeToSortSection(forceLayout)
10171017
end
10181018
local width = max(self.Content:GetWidth(), self.minWidth or 0)
10191019
local numCols = floor((width + ITEM_SPACING) / (ITEM_SIZE + ITEM_SPACING))
1020+
if numCols == 0 then numCols = 1 end
10201021
local resized = section:SetSizeInSlots(numCols, ceil(section.count / numCols))
10211022
section:Show()
10221023
if forceLayout or resized or not section:IsShown() then

0 commit comments

Comments
 (0)