From 7b9ac9a4b681ec228ab5f80e6ead3de96a0ba047 Mon Sep 17 00:00:00 2001 From: Sammy <53350357+1Turtle@users.noreply.github.com> Date: Sat, 6 Aug 2022 01:55:37 +0200 Subject: [PATCH] Wont crash when github/http API is shit --- cosu.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cosu.lua b/cosu.lua index 1c62150..4a45a4e 100644 --- a/cosu.lua +++ b/cosu.lua @@ -253,7 +253,7 @@ function update(event, ...) --[[ Check updates ]] if http then local gitAPI=http.get(sGithub.api) - if gitAPI.getResponseCode()==200 then + if gitAPI and gitAPI.getResponseCode()==200 then local tGitContent = textutils.unserialiseJSON(gitAPI.readAll()) if tGitContent.tag_name ~= sVersion then gitAPI.close()