Skip to content

Commit

Permalink
fix(calendar): Fix possible null ref in measure
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Jun 2, 2021
1 parent d589e89 commit 70c5afa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ICustomScrollInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ internal static class CustomScrollInfoExtensions
{
public static void ApplyViewport(this ICustomScrollInfo scrollInfo, ref Size size)
{
if (scrollInfo is null)
{
return;
}

if (scrollInfo.ViewportWidth is { } width)
{
size.Width = width;
Expand All @@ -35,6 +40,11 @@ public static void ApplyViewport(this ICustomScrollInfo scrollInfo, ref Size siz

public static void ApplyViewport(this ICustomScrollInfo scrollInfo, ref Rect rect)
{
if (scrollInfo is null)
{
return;
}

if (scrollInfo.ViewportWidth is { } width)
{
rect.Width = width;
Expand Down

0 comments on commit 70c5afa

Please sign in to comment.