Skip to content

Commit

Permalink
fix(radio): make sure the type is table
Browse files Browse the repository at this point in the history
  • Loading branch information
AvarianKnight committed Dec 16, 2021
1 parent 229d7f6 commit 34b9521
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions server/module/radio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,15 @@ AddEventHandler("onResourceStop", function(resource)
logger.warn('Channel %s had its radio check removed because the resource that gave the checks stopped', channel)
end
end
local radioRef = radioNameGetter.__cfx_functionReference
if radioRef then
local isResource = string.match(functionRef, resource)
if isResource then
radioNameGetter = radioNameGetter_orig
logger.warn('Radio name getter is resetting to default because the resource that gave the cb got turned off')

if type(radioNameGetter) == "table" then
local radioRef = radioNameGetter.__cfx_functionReference
if radioRef then
local isResource = string.match(functionRef, resource)
if isResource then
radioNameGetter = radioNameGetter_orig
logger.warn('Radio name getter is resetting to default because the resource that gave the cb got turned off')
end
end
end

Expand Down

0 comments on commit 34b9521

Please sign in to comment.