From 757c4d7b6f8a4fc2e4b24ba73db0d40b9420fe1b Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 10 Mar 2026 16:16:21 +0100 Subject: [PATCH] Icarus 3.1c2 : - correzione per crash dopo conferma edit materiali senza materiale corrente in top bar (progetto nuovo). --- Icarus/MaterialDb/MaterialDbVM.vb | 20 +++++++++++--------- Icarus/My Project/AssemblyInfo.vb | 4 ++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Icarus/MaterialDb/MaterialDbVM.vb b/Icarus/MaterialDb/MaterialDbVM.vb index 330de52..6f82fbd 100644 --- a/Icarus/MaterialDb/MaterialDbVM.vb +++ b/Icarus/MaterialDb/MaterialDbVM.vb @@ -283,17 +283,19 @@ Public Class MaterialDbVM ' aggiorno lista materiali Db Init() ' aggiorno lista materiali TopBar - Dim PrevMaterialGuid As String = Map.refTopPanelVM.SelMaterial.sGUID Map.refTopPanelVM.InitMaterialList() - Dim PrevMaterial As MaterialIndex = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sGUID = PrevMaterialGuid) - If Not IsNothing(PrevMaterial) Then - Map.refTopPanelVM.SetSelMaterial(PrevMaterial) - Else - Map.refTopPanelVM.SelMaterial = Nothing - Map.refTopPanelVM.NotifyPropertyChanged(NameOf(Map.refTopPanelVM.SelMaterial)) + If Not IsNothing(Map.refTopPanelVM.SelMaterial) Then + Dim PrevMaterialGuid As String = Map.refTopPanelVM.SelMaterial.sGUID + Dim PrevMaterial As MaterialIndex = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sGUID = PrevMaterialGuid) + If Not IsNothing(PrevMaterial) Then + Map.refTopPanelVM.SetSelMaterial(PrevMaterial) + Else + Map.refTopPanelVM.SelMaterial = Nothing + Map.refTopPanelVM.NotifyPropertyChanged(NameOf(Map.refTopPanelVM.SelMaterial)) + End If + ' ricarico lavorazioni per aggiorno liste materiali all'interno + Map.refMachiningDbVM.Init() End If - ' ricarico lavorazioni per aggiorno liste materiali all'interno - Map.refMachiningDbVM.Init() End If ' ripristino modalita' standard Map.refTopPanelVM.SelPage = Pages.MODIFY diff --git a/Icarus/My Project/AssemblyInfo.vb b/Icarus/My Project/AssemblyInfo.vb index b30c575..f20e5af 100644 --- a/Icarus/My Project/AssemblyInfo.vb +++ b/Icarus/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + +