readdir() fails if the directory is an URL, so just exit instead of letting the Lua script fail.
Showing the changes to TOOLS/lua/autoload.lua (1 of 1 file). Show all
Unified · Split
| @@ -25,6 +25,9 @@ function find_and_add_entries() · 24 unmodified lines | |||
| 25 | return | 25 | return |
| 26 | end | 26 | end |
| 27 | local files = mputils.readdir(dir, "files") | 27 | local files = mputils.readdir(dir, "files") |
| 28 | if files == nil then | ||
| 29 | return | ||
| 30 | end | ||
| 28 | table.sort(files) | 31 | table.sort(files) |
| 29 | if dir == "." then | 32 | if dir == "." then |
| 30 | dir = "" | 33 | dir = "" |