From 73e6c1cc4c48dd0f2d7d929f44142e9b509a6ea4 Mon Sep 17 00:00:00 2001 From: Nick Randolph Date: Tue, 6 Jun 2023 11:35:19 +1000 Subject: [PATCH] fix: Adding null check before calling Update on Bindings --- .../ForceBindingsUpdateGenTool_1.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Uno.Extensions.Navigation.Generators/ForceBindingsUpdateGenTool_1.cs b/src/Uno.Extensions.Navigation.Generators/ForceBindingsUpdateGenTool_1.cs index db1ec6db63..0699f3c13e 100644 --- a/src/Uno.Extensions.Navigation.Generators/ForceBindingsUpdateGenTool_1.cs +++ b/src/Uno.Extensions.Navigation.Generators/ForceBindingsUpdateGenTool_1.cs @@ -61,8 +61,11 @@ private string Generate(INamedTypeSymbol model) bases: updateInterface, code: $@" ValueTask IForceBindingsUpdate.ForceBindingsUpdateAsync() - {{ - this.Bindings.Update(); + {{ + if(this.Bindings is not null) + {{ + this.Bindings.Update(); + }} return ValueTask.CompletedTask; }} ");