Skip to content

Commit

Permalink
Guard against possible infinity.
Browse files Browse the repository at this point in the history
Guard against possible infinity if exiting measure early.
  • Loading branch information
ButchersBoy committed Dec 2, 2015
1 parent 261b9a2 commit e63d891
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion VirtualCollection/VirtualCollection/VirtualizingWrapPanel.cs
Expand Up @@ -78,7 +78,8 @@ protected override Size MeasureOverride(Size availableSize)
{
if (_itemsControl == null)
{
return availableSize;
return new Size(double.IsInfinity(availableSize.Width) ? 0 : availableSize.Width,
double.IsInfinity(availableSize.Height) ? 0 : availableSize.Height);
}

_isInMeasure = true;
Expand Down

0 comments on commit e63d891

Please sign in to comment.