check if button exists first
This commit is contained in:
parent
6fecdeb68d
commit
cc11aa25b7
@ -17,6 +17,9 @@ local SetButtonState = function(button, state)
|
||||
end
|
||||
|
||||
local RemoveButton = function(buttonTable, button)
|
||||
if not button then
|
||||
return
|
||||
end
|
||||
for id, v in pairs(buttonTable) do
|
||||
if buttonTable[id].optionDisplay == button.stringRef then
|
||||
table.remove(buttonTable, id)
|
||||
@ -31,6 +34,9 @@ local RemoveSpaces = function(buttonTable)
|
||||
end
|
||||
|
||||
local GetButtonIndex = function(buttonTable, button)
|
||||
if not button then
|
||||
return nil
|
||||
end
|
||||
for id, v in pairs(buttonTable) do
|
||||
if buttonTable[id].optionDisplay == button.stringRef then
|
||||
return id
|
||||
|
Loading…
Reference in New Issue
Block a user