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