Skip to content

Commit

Permalink
wip: re-add some checks for none
Browse files Browse the repository at this point in the history
  • Loading branch information
JHolba committed Jan 14, 2025
1 parent 97b3ca2 commit 11ca8e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/ert/gui/ertwidgets/listeditbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ def textUnderCursor(self) -> str:

def keyPressEvent(self, arg__1: QKeyEvent) -> None:
popup = self._completer.popup()
if popup and popup.isVisible() and arg__1.key() in self.__keysToIgnore:
if (
popup is not None
and popup.isVisible()
and arg__1 is not None
and arg__1.key() in self.__keysToIgnore
):
arg__1.ignore()
return

Expand All @@ -61,7 +66,7 @@ def keyPressEvent(self, arg__1: QKeyEvent) -> None:
completion_prefix = self.textUnderCursor()
if completion_prefix != self._completer.completionPrefix():
self.__updateCompleterPopupItems(completion_prefix)
if len(arg__1.text()) > 0 and len(completion_prefix) > 0:
if arg__1 is not None and len(arg__1.text()) > 0 and len(completion_prefix) > 0:
self._completer.complete()
if popup is not None and len(completion_prefix) == 0:
popup.hide()
Expand Down
2 changes: 1 addition & 1 deletion src/ert/gui/simulation/run_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def __init__(
QFrame.__init__(self, parent)
self.output_path = output_path
self.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose)
self.setWindowFlags(Qt.WindowType.Window)
self.setWindowFlag(Qt.WindowType.Window, True)
self.setWindowFlag(Qt.WindowType.WindowContextHelpButtonHint, False)
self.setWindowTitle(f"Experiment - {config_file} {find_ert_info()}")

Expand Down

0 comments on commit 11ca8e2

Please sign in to comment.