fix(server/events): error handle MySQL.ready

This commit is contained in:
Kasey FItton
2024-07-12 00:24:17 +01:00
parent e39fe89140
commit be3bbb8abf
+6 -5
View File
@@ -19,10 +19,10 @@ AddEventHandler('playerDropped', function(reason)
end)
-- Player Connecting
local databaseConnected = false
local bansTableExists = false
MySQL.Ready(function()
local readyFunction = MySQL.ready
local databaseConnected, bansTableExists = readyFunction == nil, readyFunction == nil
if readyFunction ~= nil then
MySQL.ready(function()
databaseConnected = true
local DatabaseInfo = QBCore.Functions.GetDatabaseInfo()
@@ -32,7 +32,8 @@ MySQL.Ready(function()
if result and result[1] then
bansTableExists = true
end
end)
end)
end
local function onPlayerConnecting(name, _, deferrals)
local src = source