Additional Changes to Correct Null Exception for #12

- Additional changes to prevent Null Exception when catalog mapping property is null.
This commit is contained in:
Frog
2026-03-16 22:58:00 -07:00
parent 3dae7508f0
commit 322490d0b2
+2 -2
View File
@@ -64,7 +64,7 @@ internal static class EpicStore
foreach (Element element in searchStore)
{
string title = element.Title;
string product = element.CatalogNs is not null && element.CatalogNs.Mappings.Length > 0
string product = element.CatalogNs?.Mappings is { Length: > 0 }
? element.CatalogNs.Mappings.First().PageSlug
: null;
string icon = null;
@@ -85,7 +85,7 @@ internal static class EpicStore
foreach (Element element in catalogOffers)
{
string title = element.Title;
string product = element.CatalogNs is not null && element.CatalogNs.Mappings.Length > 0
string product = element.CatalogNs?.Mappings is { Length: > 0 }
? element.CatalogNs.Mappings.First().PageSlug
: null;
string icon = null;