Skip to content

Commit

Permalink
Wont crash when github/http API is shit
Browse files Browse the repository at this point in the history
  • Loading branch information
SammyForReal authored Aug 5, 2022
1 parent 42d4ecb commit 7b9ac9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cosu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 7b9ac9a

Please sign in to comment.