mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 06:32:53 +01:00
fix: abort on empty model
This commit is contained in:
1 parent
2e5860650f
commit
bc4fc8005d
1 file changed
+3
-3
@@ -32,12 +32,12 @@ class CursorMixin:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def _move_cursor(self, position: CursorPosition) -> bool:
|
def _move_cursor(self, position: CursorPosition) -> bool:
|
||||||
cur_row = self.get_focused_row_index() # type: ignore
|
|
||||||
model = self.get_model() # type: ignore
|
model = self.get_model() # type: ignore
|
||||||
if model:
|
if len(model) > 0:
|
||||||
end = len(model) - 1
|
end = len(model) - 1
|
||||||
else:
|
else:
|
||||||
return True
|
return False
|
||||||
|
cur_row = self.get_focused_row_index() # type: ignore
|
||||||
|
|
||||||
if position == CursorPosition.DOWN:
|
if position == CursorPosition.DOWN:
|
||||||
if cur_row == end:
|
if cur_row == end:
|
||||||
|
|||||||
Reference in new issue
Block a user