diff --git a/server/main.lua b/server/main.lua index 59f3a6e..3abd23e 100644 --- a/server/main.lua +++ b/server/main.lua @@ -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") @@ -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 \ No newline at end of file +commands["devinfo"].callbackfailed = function(source, args, user)end