NRE fixes

This commit is contained in:
z__
2022-02-01 11:39:00 +07:00
parent 55eac7ecbf
commit 9a6253d0ef

View File

@@ -13,12 +13,12 @@ namespace Torch.Server.Views
public static bool GetScrollContainer(this UIElement ui)
{
return (bool)ui.GetValue(ScrollContainerProperty);
return (bool) (ui?.GetValue(ScrollContainerProperty) ?? false);
}
public static void SetScrollContainer(this UIElement ui, bool value)
{
ui.SetValue(ScrollContainerProperty, value);
ui?.SetValue(ScrollContainerProperty, value);
}
}
}