Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(CacheManager): GetJsonStringByTypeName prevent throw ArgumentNull exception #5106

Merged
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/Services/CacheManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ private static JsonLocalizationOptions GetJsonLocalizationOption()
var sections = Instance.GetOrCreate(key, entry => option.GetJsonStringFromAssembly(assembly, cultureName));
var items = sections.FirstOrDefault(kv => typeName.Equals(kv.Key, StringComparison.OrdinalIgnoreCase))?
.GetChildren()
.SelectMany(kv => new[] { new LocalizedString(kv.Key, kv.Value!, false, typeName) });
.SelectMany(kv => new[] { new LocalizedString(kv.Key, kv.Value?? kv.Key, false, typeName) });
#if NET8_0_OR_GREATER
return items?.ToFrozenSet();
#else
Expand Down
Loading