mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-18 10:08:34 +00:00
fix(menu): prevent opening empty menu (#675)
This commit is contained in:
1 parent
f89536437a
commit
79f311a365
1 file changed
+5
@@ -49,6 +49,11 @@ function lib.showMenu(id, startIndex)
|
||||
if not menu then
|
||||
error(('No menu with id %s was found'):format(id))
|
||||
end
|
||||
|
||||
if table.type(menu.options) == 'empty' then
|
||||
error(('Can\'t open empty menu with id %s'):format(id))
|
||||
end
|
||||
|
||||
if not openMenu then
|
||||
local control = cache.game == 'fivem' and 140 or 0xE30CD707
|
||||
|
||||
|
||||
Reference in new issue
Block a user