From 34b952181358613402f8233ce346b50a6131a47a Mon Sep 17 00:00:00 2001 From: Avarian Knight Date: Thu, 16 Dec 2021 01:45:11 -0600 Subject: [PATCH] fix(radio): make sure the type is table --- server/module/radio.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/server/module/radio.lua b/server/module/radio.lua index 2cf5049..9abd633 100644 --- a/server/module/radio.lua +++ b/server/module/radio.lua @@ -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