diff --git a/src/python/impactx/dashboard/Input/latticeConfiguration/latticeMain.py b/src/python/impactx/dashboard/Input/latticeConfiguration/latticeMain.py index 5371042c2..c3d16e740 100644 --- a/src/python/impactx/dashboard/Input/latticeConfiguration/latticeMain.py +++ b/src/python/impactx/dashboard/Input/latticeConfiguration/latticeMain.py @@ -156,7 +156,12 @@ def on_lattice_element_name_change(selectedLattice, **kwargs): @ctrl.add("add_latticeElement") def on_add_lattice_element_click(): selectedLattice = state.selectedLattice - if selectedLattice: + + if selectedLattice not in state.listOfLatticeElements: + state.isSelectedLatticeListEmpty = ( + f"Lattice element '{selectedLattice}' does not exist." + ) + else: add_lattice_element() state.dirty("selectedLatticeList")