From 2dc970a8bbcae9c1ffb6846414a3b98f0babaefd Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Wed, 28 Jul 2021 16:00:17 +0100 Subject: [PATCH] Don't error when given a malformed URL Sometimes the pattern fails to match and so the file name ends up being nil. --- .../resources/data/computercraft/lua/rom/programs/http/wget.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/data/computercraft/lua/rom/programs/http/wget.lua b/src/main/resources/data/computercraft/lua/rom/programs/http/wget.lua index a151eb28b..042660c02 100644 --- a/src/main/resources/data/computercraft/lua/rom/programs/http/wget.lua +++ b/src/main/resources/data/computercraft/lua/rom/programs/http/wget.lua @@ -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")