fix(client/context): Throw error when context id doesn't exist

Opening a context menu before registering it would previously result in the script completely erroring out and having stuck nui focus
This commit is contained in:
Luke
2022-04-15 11:27:08 +02:00
parent c21054280c
commit 282d81500c

View File

@@ -2,6 +2,7 @@ local contextMenus = {}
local openContextMenu = nil
function lib.showContext(id)
if not contextMenus[id] then return error('No context menu of such id found.') end
local data = contextMenus[id]
openContextMenu = id
SetNuiFocus(true, true)