From 465b7d1a098f828bf185e0949f477ea4cae86aeb Mon Sep 17 00:00:00 2001 From: Davide Sandrelli Date: Mon, 29 Dec 2025 17:36:07 +0100 Subject: [PATCH] - FIX Home (codice Guid non valido) --- StandManager/Components/Pages/Home.razor | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/StandManager/Components/Pages/Home.razor b/StandManager/Components/Pages/Home.razor index 362d004..b24d17f 100644 --- a/StandManager/Components/Pages/Home.razor +++ b/StandManager/Components/Pages/Home.razor @@ -119,17 +119,22 @@ : new(); invito = dbInvito; - - var destinazioniIds = invito.IscrizioniEvento?.Select(x => x.DestinazioneId).ToList() ?? new List(); - destinazioniList = (await _managerService.DestinazioneService.RicercaQueryable(filtro: x => x.ClienteId == invito.ClienteId && !destinazioniIds.Any(y => y == x.Id))).Select(x => (DestinazioneViewModel)x).ToList(); - StateHasChanged(); + + if (invito == null) + invalidCode = "Il codice inserito non risulta corretto"; + else + { + var destinazioniIds = invito?.IscrizioniEvento?.Select(x => x.DestinazioneId).ToList() ?? new List(); + destinazioniList = (await _managerService.DestinazioneService.RicercaQueryable(filtro: x => x.ClienteId == invito.ClienteId && !destinazioniIds.Any(y => y == x.Id))).Select(x => (DestinazioneViewModel)x).ToList(); + StateHasChanged(); + } } protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) await BodyClass.SetBodyClass("body-marketing body-gradient"); - if (invito.Id != Guid.Empty && registrazione != null) + if (invito?.Id != Guid.Empty && registrazione != null) await registrazione.SetDatiCliente(); }