Don't error when given a malformed URL

Sometimes the pattern fails to match and so the file name ends up being
nil.
This commit is contained in:
Jonathan Coates 2021-07-28 16:00:17 +01:00
parent f74c4cc83c
commit 2dc970a8bb
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ if run then
printError(err)
end
else
local sFile = tArgs[1] or getFilename(url)
local sFile = tArgs[1] or getFilename(url) or url
local sPath = shell.resolve(sFile)
if fs.exists(sPath) then
print("File already exists")