diff --git a/builder/builder.lua b/builder/builder.lua index a41677f..a2a5138 100644 --- a/builder/builder.lua +++ b/builder/builder.lua @@ -737,7 +737,7 @@ end --[[-- startup logic --]]-- local args = {...} if #args < 1 then - error('supply file name') + error('supply file name or URL') end Builder.itemAdapter = Adapter.wrap({ side = 'bottom', direction = 'up' }) diff --git a/milo/plugins/remote/setup.lua b/milo/plugins/remote/setup.lua index 10dfd7c..3ba5439 100644 --- a/milo/plugins/remote/setup.lua +++ b/milo/plugins/remote/setup.lua @@ -70,7 +70,9 @@ function setup:eventHandler(event) if not fs.exists(STARTUP_FILE) then Util.writeFile(STARTUP_FILE, [[os.sleep(1) -shell.openForegroundTab('packages/milo/MiloRemote')]]) +if shell.openForegroundTab then + shell.openForegroundTab('packages/milo/MiloRemote') +end]]) end elseif fs.exists(STARTUP_FILE) then fs.delete(STARTUP_FILE) diff --git a/swshop/w.lua b/swshop/w.lua index 9b25fe7..85fadf7 100644 --- a/swshop/w.lua +++ b/swshop/w.lua @@ -72,14 +72,14 @@ function init(jua) if async then jua.on("websocket_success", function(event, url, handle) local success, id = pcall(findID,url) - if id and callbackRegistry[id] and callbackRegistry[id].success then + if success and id and callbackRegistry[id] and callbackRegistry[id].success then callbackRegistry[id].success(id, handle) end end) jua.on("websocket_failure", function(event, url) local success, id = pcall(findID,url) - if id and callbackRegistry[id] and callbackRegistry[id].failure then + if success and id and callbackRegistry[id] and callbackRegistry[id].failure then callbackRegistry[id].failure(id) end table.remove(callbackRegistry, id) @@ -87,14 +87,14 @@ function init(jua) jua.on("websocket_message", function(event, url, data) local success, id = pcall(findID,url) - if id and callbackRegistry[id] and callbackRegistry[id].message then + if success and id and callbackRegistry[id] and callbackRegistry[id].message then callbackRegistry[id].message(id, data) end end) jua.on("websocket_closed", function(event, url) local success, id = pcall(findID,url) - if id and callbackRegistry[id] and callbackRegistry[id].closed then + if success and id and callbackRegistry[id] and callbackRegistry[id].closed then callbackRegistry[id].closed(id) end table.remove(callbackRegistry, id)