зеркало из https://github.com/DeGsoft/maui-linux.git
[X] check for null on the parent property (#5796)
In case of value types in Compiled Binding Paths, we weren't checking for null property on the right part of the path before ```csharp bindingExtension.TypedBinding = new TypedBinding<Gh5770, Color>(delegate(Gh5770 gh) { if (gh == null) { return new ValueTuple<Color, bool>(default(Color), false); } Gh5770VM expr_24 = gh.MyContentViewModel; return new ValueTuple<Color, bool>(expr_24.TextColor, true); }, ..., ...); ``` after ```csharp bindingExtension.TypedBinding = new TypedBinding<Gh5770, Color>(delegate(Gh5770 gh) { if (gh == null) { return new ValueTuple<Color, bool>(default(Color), false); } Gh5770VM expr_24 = gh.MyContentViewModel; if (expr_24 == null) { return new ValueTuple<Color, bool>(default(Color), false); } return new ValueTuple<Color, bool>(expr_24.TextColor, true); }, ..., ...); ``` - fixes #5770
This commit is contained in:
Родитель
ab164c0ede
Коммит
b181e019c9
|
@ -549,7 +549,7 @@ namespace Xamarin.Forms.Build.Tasks
|
|||
il.Emit(Ldloca, loc);
|
||||
}
|
||||
|
||||
if (!property.PropertyType.IsValueType) { //if part of the path is null, return (default(T), false)
|
||||
if (!propDeclTypeRef.IsValueType) { //if part of the path is null, return (default(T), false)
|
||||
var nop = Create(Nop);
|
||||
il.Emit(Dup);
|
||||
il.Emit(Ldnull);
|
||||
|
|
Загрузка…
Ссылка в новой задаче