From 8f98a3fb0fe3228bfb39345f44f84484688cdb03 Mon Sep 17 00:00:00 2001 From: Radek Vykydal Date: Mar 19 2021 15:30:47 +0000 Subject: Fix crash in NTP servers GUI dialog on late network configuration Resolves: rhbz#1938168 --- diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py index a64879c..50ae156 100644 --- a/pyanaconda/ui/gui/spokes/datetime_spoke.py +++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py @@ -324,15 +324,18 @@ class NTPconfigDialog(GUIObject, GUIDialogInputCheckHandler): #check if we are in the same epoch as the dialog (and the serversStore) #and if the server wasn't changed meanwhile if epoch_started == self._epoch: - actual_hostname = self._serversStore[itr][SERVER_HOSTNAME] - - if orig_hostname == actual_hostname: - if server_working: - set_store_value((self._serversStore, - itr, SERVER_WORKING, constants.NTP_SERVER_OK)) - else: - set_store_value((self._serversStore, - itr, SERVER_WORKING, constants.NTP_SERVER_NOK)) + # rhbz#1938168 - when called on Spoke enter / refresh the store can + # be cleared by opening NTPConfigDialog + if self._serversStore.iter_is_valid(itr): + actual_hostname = self._serversStore[itr][SERVER_HOSTNAME] + + if orig_hostname == actual_hostname: + if server_working: + set_store_value((self._serversStore, + itr, SERVER_WORKING, constants.NTP_SERVER_OK)) + else: + set_store_value((self._serversStore, + itr, SERVER_WORKING, constants.NTP_SERVER_NOK)) self._epoch_lock.release() @async_action_nowait