Browse Source

Add null check for scroller.

pull/4452/head
Steven Kirk 6 years ago
parent
commit
2337da31b1
  1. 9
      src/Avalonia.Controls/Repeater/ViewportManager.cs

9
src/Avalonia.Controls/Repeater/ViewportManager.cs

@ -350,11 +350,14 @@ namespace Avalonia.Controls
}
// Make sure that only the target child can be the anchor during the bring into view operation.
foreach (var child in _owner.Children)
if (_scroller is object)
{
if (child != targetChild)
foreach (var child in _owner.Children)
{
_scroller.UnregisterAnchorCandidate(child);
if (child != targetChild)
{
_scroller.UnregisterAnchorCandidate(child);
}
}
}

Loading…
Cancel
Save