From 0ce96d9eb4f3a426f6d22e8d3b151a4cc3207060 Mon Sep 17 00:00:00 2001 From: metacube Date: Fri, 5 Jun 2026 07:57:49 +0200 Subject: [PATCH] Handle null navigation menu values --- .../Services/NavigationMenuService.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/TrafagSalesExporter/Services/NavigationMenuService.cs b/TrafagSalesExporter/Services/NavigationMenuService.cs index a20c81c..22b1c98 100644 --- a/TrafagSalesExporter/Services/NavigationMenuService.cs +++ b/TrafagSalesExporter/Services/NavigationMenuService.cs @@ -21,6 +21,23 @@ public sealed class NavigationMenuService : INavigationMenuService .OrderBy(x => x.ParentKey ?? string.Empty) .ThenBy(x => x.SortOrder) .ThenBy(x => x.TitleDe) + .Select(x => new NavigationMenuItem + { + Id = x.Id, + Key = x.Key ?? string.Empty, + ParentKey = string.IsNullOrWhiteSpace(x.ParentKey) ? null : x.ParentKey, + TitleDe = x.TitleDe ?? string.Empty, + TitleEn = x.TitleEn ?? string.Empty, + Icon = x.Icon ?? string.Empty, + Href = x.Href ?? string.Empty, + ItemType = x.ItemType ?? NavigationMenuItemTypes.Link, + Match = x.Match ?? "Prefix", + RequiredPolicy = x.RequiredPolicy ?? string.Empty, + IsVisible = x.IsVisible, + IsExpanded = x.IsExpanded, + IsSystem = x.IsSystem, + SortOrder = x.SortOrder + }) .ToListAsync(); }