Skip to content

Commit

Permalink
fix issue where i try printing non-existent property on none in ensem…
Browse files Browse the repository at this point in the history
…bleselector

This raised an AttributeError which Qt swallowed
  • Loading branch information
jonathan-eq committed Dec 18, 2024
1 parent f1d779c commit 2fe1d74
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/ert/gui/ertwidgets/ensembleselector.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,7 @@ def __init__(

@property
def selected_ensemble(self) -> Ensemble:
print("GETTING SELECTED_ENSEMBLE")
print(f"{self.count()=}")
try:
itemData: LocalEnsemble = self.itemData(self.currentIndex())
except Exception as e:
print(f"{e=}")
raise e

print(f"{itemData.experiment.is_valid()=}")
itemData: LocalEnsemble | None = self.itemData(self.currentIndex())
return itemData

Check failure on line 65 in src/ert/gui/ertwidgets/ensembleselector.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Incompatible return value type (got "LocalEnsemble | None", expected "LocalEnsemble")

def populate(self) -> None:
Expand Down

0 comments on commit 2fe1d74

Please sign in to comment.