Browse Source

Throw if no matching property accessor found.

This shouldn't happen normally as `InpcPropertyAcessorPlugin` matches everything.
Steven Kirk 7 years ago
parent
commit
6d0e461349
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/Avalonia.Base/Data/Core/PropertyAccessorNode.cs

+ 6 - 0
src/Avalonia.Base/Data/Core/PropertyAccessorNode.cs

@@ -53,6 +53,12 @@ namespace Avalonia.Data.Core
                 }
             }
 
+            if (accessor == null)
+            {
+                throw new NotSupportedException(
+                    $"Could not find a matching property accessor for {PropertyName}.");
+            }
+
             accessor.Subscribe(ValueChanged);
             _accessor = accessor;
         }