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