Skip to content

Commit

Permalink
Fix crash on settings accept
Browse files Browse the repository at this point in the history
  • Loading branch information
trots committed Jun 8, 2024
1 parent e0eb814 commit 4382182
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def set_current_index(self, index):
if self._bar_set is not None:
self._bar_set.deselectAllBars()

if index is None:
if index is None or not self._model.has_data():
return

row = index.row()
Expand Down
3 changes: 3 additions & 0 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ def clear(self):
self.result.clear()
self.endResetModel()

def has_data(self):
return len(self.result) > 0

def set_sort_cast(self, column: int, cast_func):
self._sort_cast[column] = cast_func

Expand Down

0 comments on commit 4382182

Please sign in to comment.