Skip to content

Commit

Permalink
fix: Possible NRE when applying visual state setters on unknown targets
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed May 19, 2021
1 parent e8afc69 commit b995392
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Uno.UI/UI/Xaml/ResourceResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ internal static void ApplyResource(DependencyObject owner, DependencyProperty pr
/// </returns>
internal static bool ApplyVisualStateSetter(SpecializedResourceDictionary.ResourceKey resourceKey, object context, BindingPath bindingPath, DependencyPropertyValuePrecedences precedence)
{
if (TryStaticRetrieval(resourceKey, context, out var value))
if (TryStaticRetrieval(resourceKey, context, out var value)
&& bindingPath.DataContext != null)
{
var property = DependencyProperty.GetProperty(bindingPath.DataContext.GetType(), bindingPath.LeafPropertyName);
if (property != null && bindingPath.DataContext is IDependencyObjectStoreProvider provider)
Expand Down

0 comments on commit b995392

Please sign in to comment.