Skip to content

Commit df86a0e

Browse files
committed
Ensured use of IsConvertible property in SetValue()
As this value is now cached as a local property, that should be called.
1 parent a701089 commit df86a0e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

OnTopic/Internal/Reflection/MemberAccessor.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,8 @@ internal bool IsSettable(Type? sourceType = null, bool allowConversion = false)
109109
return true;
110110
}
111111
if (allowConversion) {
112-
var isTargetCompatible = AttributeValueConverter.IsConvertible(Type);
113-
var isSourceCompatible = sourceType is null || AttributeValueConverter.IsConvertible(sourceType);
114-
return isTargetCompatible && isSourceCompatible;
112+
var isSourceConvertible = sourceType is null || AttributeValueConverter.IsConvertible(sourceType);
113+
return IsConvertible && isSourceConvertible;
115114
}
116115
return false;
117116
}

0 commit comments

Comments
 (0)