Browse Source
Check if BindingValue actually has a value
pull/8252/head
Max Katz
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
2 deletions
-
src/Avalonia.Base/Reactive/TypedBindingAdapter.cs
|
|
|
@ -30,13 +30,15 @@ namespace Avalonia.Reactive |
|
|
|
} |
|
|
|
catch (InvalidCastException e) |
|
|
|
{ |
|
|
|
var unwrappedValue = value.HasValue ? value.Value : null; |
|
|
|
|
|
|
|
Logger.TryGet(LogEventLevel.Error, LogArea.Binding)?.Log( |
|
|
|
_target, |
|
|
|
"Binding produced invalid value for {$Property} ({$PropertyType}): {$Value} ({$ValueType})", |
|
|
|
_property.Name, |
|
|
|
_property.PropertyType, |
|
|
|
value.Value, |
|
|
|
value.Value?.GetType()); |
|
|
|
unwrappedValue, |
|
|
|
unwrappedValue?.GetType()); |
|
|
|
PublishNext(BindingValue<T>.BindingError(e)); |
|
|
|
} |
|
|
|
} |
|
|
|
|