Skip to content

Commit a3a45d2

Browse files
committed
fix: remove chance of infinite loop
1 parent 184f1a6 commit a3a45d2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ess/reflectometry/gui.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,9 @@ def sync_custom_reduction_table(self):
650650

651651
def display_results(self):
652652
df = self.get_selected_rows()
653+
if len(df) == 0:
654+
self.log('There was nothing to display')
655+
return
653656
try:
654657
results = [
655658
next(v for (m, _), v in self.results.items() if m == key)
@@ -770,6 +773,7 @@ def get_selected_rows(self):
770773
for table in (self.reduction_table, self.custom_reduction_table)
771774
for s in table.selections
772775
]
776+
# Select everything if nothing is selected
773777
if len(chunks) == 0:
774778
chunks = [self.reduction_table.data, self.custom_reduction_table.data]
775779
return pd.concat(chunks)

0 commit comments

Comments
 (0)