Skip to content

Commit

Permalink
Fix MissingMemberException calls (#3432)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev authored Aug 31, 2023
1 parent 641f2dc commit 2b2821f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* None

### Fixed
* None
* Fixed the message of the `MissingMemberException` being thrown when attempting to access a non-existent property with the dynamic API. (PR [#3432](https://github.com/realm/realm-dotnet/pull/3432))

### Compatibility
* Realm Studio: 13.0.0 or later.
Expand Down
4 changes: 2 additions & 2 deletions Realm/Realm/Dynamic/DynamicObjectApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private Property GetProperty(string propertyName)
{
if (!_managedAccessor.ObjectSchema.TryFindProperty(propertyName, out var property))
{
throw new MissingMemberException($"Property {propertyName} does not exist on RealmObject of type {_managedAccessor.ObjectSchema.Name}", propertyName);
throw new MissingMemberException(_managedAccessor.ObjectSchema.Name, propertyName);
}

return property;
Expand All @@ -251,7 +251,7 @@ private Property GetProperty(string propertyName, Func<PropertyType, bool> typeC

if (!_managedAccessor.ObjectSchema.TryFindProperty(propertyName, out var property))
{
throw new MissingMemberException($"Property {propertyName} does not exist on RealmObject of type {_managedAccessor.ObjectSchema.Name}", propertyName);
throw new MissingMemberException(_managedAccessor.ObjectSchema.Name, propertyName);
}

if (!typeCheck(property.Type))
Expand Down

0 comments on commit 2b2821f

Please sign in to comment.