mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-19 07:56:02 +01:00
fix: no-op
This commit is contained in:
@@ -84,4 +84,4 @@ if service == 'datadog' then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return lib.logger or function() end
|
return lib.logger
|
||||||
|
|||||||
6
init.lua
6
init.lua
@@ -18,6 +18,7 @@ end
|
|||||||
|
|
||||||
local LoadResourceFile = LoadResourceFile
|
local LoadResourceFile = LoadResourceFile
|
||||||
local context = IsDuplicityVersion() and 'server' or 'client'
|
local context = IsDuplicityVersion() and 'server' or 'client'
|
||||||
|
local function noop() end
|
||||||
|
|
||||||
local function loadModule(self, module)
|
local function loadModule(self, module)
|
||||||
local dir = ('imports/%s'):format(module)
|
local dir = ('imports/%s'):format(module)
|
||||||
@@ -36,7 +37,7 @@ local function loadModule(self, module)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local result = fn()
|
local result = fn()
|
||||||
self[module] = result or function() end
|
self[module] = result or noop
|
||||||
return self[module]
|
return self[module]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -51,6 +52,7 @@ local function call(self, index, ...)
|
|||||||
local module = rawget(self, index)
|
local module = rawget(self, index)
|
||||||
|
|
||||||
if not module then
|
if not module then
|
||||||
|
self[index] = noop
|
||||||
module = loadModule(self, index)
|
module = loadModule(self, index)
|
||||||
|
|
||||||
if not module then
|
if not module then
|
||||||
@@ -174,4 +176,4 @@ else
|
|||||||
function lib.notify(source, data)
|
function lib.notify(source, data)
|
||||||
TriggerClientEvent(notify, source, data)
|
TriggerClientEvent(notify, source, data)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user