Skip to content

Commit 7b9ac9a

Browse files
authored
Wont crash when github/http API is shit
1 parent 42d4ecb commit 7b9ac9a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cosu.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ function update(event, ...)
253253
--[[ Check updates ]]
254254
if http then
255255
local gitAPI=http.get(sGithub.api)
256-
if gitAPI.getResponseCode()==200 then
256+
if gitAPI and gitAPI.getResponseCode()==200 then
257257
local tGitContent = textutils.unserialiseJSON(gitAPI.readAll())
258258
if tGitContent.tag_name ~= sVersion then
259259
gitAPI.close()

0 commit comments

Comments
 (0)