fix-2740 - Handle empty iface selection (#2747)

This commit is contained in:
Daniel Girtler 2024-11-04 22:42:54 +11:00 committed by GitHub
parent 6553967be6
commit 4a06131f4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -65,6 +65,10 @@ class ManualNetworkConfig(ListManager):
all_ifaces = list_interfaces().values()
existing_ifaces = [d.iface for d in data]
available = set(all_ifaces) - set(existing_ifaces)
if not available:
return None
choice = Menu(str(_('Select interface to add')), list(available), skip=True).run()
if choice.type_ == MenuSelectionType.Skip: