Added condition to check if the job is activated to prevent the error "@esx_service/server/main.lua:52: attempt to index a nil value (field '?')" (#17)

* Fix for: SCRIPT ERROR: @esx_service/server/main.lua:52: attempt to index a nil value (field '?') Issue #9

* removed .vscode folder

* fixed invalid condition statement on line 52

* Update server/main.lua

Pushing the suggested change by @Dislaik.

Co-authored-by: Matias Salas <42161973+Dislaik@users.noreply.github.com>

Co-authored-by: Matias Salas <42161973+Dislaik@users.noreply.github.com>
This commit is contained in:
Alvin T. Veroy
2020-08-20 16:38:01 +08:00
committed by GitHub
parent 7c727ca203
commit 487a53693f
+4 -2
View File
@@ -49,8 +49,10 @@ end)
ESX.RegisterServerCallback('esx_service:isInService', function(source, cb, name)
local isInService = false
if InService[name][source] then
isInService = true
if InService[name] ~= nil then
if InService[name][source] then
isInService = true
end
end
cb(isInService)