Skip to content

Commit

Permalink
fix: BindingHelper may not provide properties when using WinUI
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed May 31, 2021
1 parent 7ffe996 commit fa1d1ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Uno.UI/DataBinding/BindingPropertyHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ private static ValueGetterHandler InternalGetValueGetter(Type type, string prope

if (bindableProperty.OwnerType != null)
{
if (bindableProperty != null && bindableProperty.Property.Getter != null)
if (bindableProperty?.Property?.Getter != null)
{
if (bindableProperty.Property.DependencyProperty is { } dependencyProperty)
{
Expand Down Expand Up @@ -841,12 +841,12 @@ private static ValueSetterHandler InternalGetValueSetter(Type type, string prope
{
if (bindableProperty != null)
{
if(bindableProperty.Property.DependencyProperty is { } dependencyProperty)
if(bindableProperty.Property?.DependencyProperty is { } dependencyProperty)
{
return (instance, value) => instance.SetValue(dependencyProperty, convertSelector(() => bindableProperty.Property.PropertyType, value), precedence);
}

if (bindableProperty.Property.Setter != null)
if (bindableProperty.Property?.Setter != null)
{
var setter = bindableProperty.Property.Setter;

Expand Down

0 comments on commit fa1d1ad

Please sign in to comment.