mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-28 13:14:44 +00:00
feat(client/interface): list menu error catching
This commit is contained in:
1 parent
dde7daddb7
commit
ac7a87cc5b
1 file changed
+3
@@ -2,6 +2,9 @@ local registeredMenus = {}
|
|||||||
local openMenu = nil
|
local openMenu = nil
|
||||||
|
|
||||||
function lib.registerMenu(data, cb)
|
function lib.registerMenu(data, cb)
|
||||||
|
if not data.id then return error('No menu id was provided.') end
|
||||||
|
if not data.title then return error('No menu title was provided.') end
|
||||||
|
if not data.options then return error('No menu options were provided.') end
|
||||||
data.cb = cb
|
data.cb = cb
|
||||||
registeredMenus[data.id] = data
|
registeredMenus[data.id] = data
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user