diff --git a/src/OrchardCore.Components/OrchardCore.Common.Components/OptionEditor.razor b/src/OrchardCore.Components/OrchardCore.Common.Components/OptionEditor.razor index 2183b811b8b..c1a1393064e 100644 --- a/src/OrchardCore.Components/OrchardCore.Common.Components/OptionEditor.razor +++ b/src/OrchardCore.Components/OrchardCore.Common.Components/OptionEditor.razor @@ -173,12 +173,24 @@ private async Task OptionItemChangeAsync(Action update) { - update(); + // validate provided delegate + if (update is not null) + { + try + { + update(); + } + catch(Exception) + { + // ignore + } + } + + // Options may have changed independent of "update" delegate, e.g. inline, so we apply update routine anyway TryUpdateOptionsJson(Options); await TriggerEventAsync(); } - protected override Task OnInitializedAsync() { SetOptionsEmpty();