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