Skip to content

Commit

Permalink
check for script before launching (#1460)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyleretters authored Oct 15, 2021
1 parent b6f19f4 commit 914f769
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lua/core/menu/select.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,19 @@ m.key = function(n,z)
elseif n==3 and z==1 then
-- return if the current "file" is the split between favorites and all scripts
if m.list[m.pos+1].file == nil then return end
_menu.previewfile = m.list[m.pos+1].file
_menu.set_page("PREVIEW")
-- make sure the file still exists
local previewfile = m.list[m.pos+1].file
if util.file_exists(previewfile) then
_menu.previewfile = previewfile
_menu.set_page("PREVIEW")
else
m.remove_favorite()
screen.clear()
screen.level(15)
screen.move(64,40)
screen.text_center("script not found")
screen.update()
end
end
end

Expand Down

0 comments on commit 914f769

Please sign in to comment.