Check if the returned table is nil

This commit is contained in:
Ksaper 2023-02-24 22:27:06 +02:00
parent 44af848a9c
commit 8c8d96702e
1 changed files with 4 additions and 1 deletions

View File

@ -295,7 +295,10 @@ local function page_forward(self, dir)
if dir == "down" then
app = self._private.grid:get_widgets_at(1, 1)[1]
elseif dir == "right" then
app = self._private.grid:get_widgets_at(pos.row, 1)[1]
app = self._private.grid:get_widgets_at(pos.row, 1)
if app then
app = app[1]
end
if app == nil then
app = self._private.grid.children[#self._private.grid.children]
end