Skip to content

Commit

Permalink
Merge pull request #87 from nathanctech/patch-1
Browse files Browse the repository at this point in the history
tweak: fix exception if updater breaks
  • Loading branch information
kanersps authored May 28, 2020
2 parents 9430b26 + 49a9702 commit 3a665aa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ local VersionAPIRequest = "https://api.kanersps.pw/em/version?version=" .. _VERS
function performVersionCheck()
print("Performing version check against: " .. VersionAPIRequest .. "\n")
PerformHttpRequest(VersionAPIRequest, function(err, rText, headers)
local decoded = json.decode(rText)

if err == 200 then
if err == 200 and rText ~= nil then
local decoded = json.decode(rText)
if(not _FirstCheckPerformed)then
print("\n" .. _Prefix .. " Current version: " .. _VERSION)
print(_Prefix .. " Updater version: " .. decoded.newVersion .. "\n")
Expand Down Expand Up @@ -399,4 +398,4 @@ commands["devinfo"].cmd = function(source, args, user)
TriggerClientEvent('chatMessage', Source, 'SYSTEM', {255, 0, 0}, "^2[^3EssentialMode^2]^0 Database: ^2 " .. db)
TriggerClientEvent('chatMessage', Source, 'SYSTEM', {255, 0, 0}, "^2[^3EssentialMode^2]^0 Logging enabled: ^2 " .. tostring(settings.defaultSettings.enableLogging))
end
commands["devinfo"].callbackfailed = function(source, args, user)end
commands["devinfo"].callbackfailed = function(source, args, user)end

0 comments on commit 3a665aa

Please sign in to comment.