diff --git a/basilisk/gui/history_msg_text_ctrl.py b/basilisk/gui/history_msg_text_ctrl.py index 34d2992c..6046f563 100644 --- a/basilisk/gui/history_msg_text_ctrl.py +++ b/basilisk/gui/history_msg_text_ctrl.py @@ -191,6 +191,8 @@ def display_new_block(self, new_block: MessageBlock): def update_last_segment_length(self): """Update the length of the last message segment to match the current text control position.""" + if not self.segment_manager.segments: + return last_position = self.GetLastPosition() self.segment_manager.absolute_position = last_position last_segment = self.segment_manager.segments[-1] @@ -418,7 +420,6 @@ def _do_search(self, direction: SearchDirection = SearchDirection.FORWARD): """ if self._search_dialog is None: self._search_dialog = SearchDialog(self.GetParent(), self) - self._search_dialog = SearchDialog(self.GetParent(), self) self._search_dialog._dir_radio_forward.SetValue( direction == SearchDirection.FORWARD )