mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user