Fix: Crash toggleswitch when args are empty (#5438)

Fix: #5434
This commit is contained in:
Robert
2019-09-30 11:18:39 +02:00
committed by Frans de Jonge
parent a0e2f02c32
commit 056a4f9129
2 changed files with 4 additions and 4 deletions

View File

@@ -535,7 +535,7 @@ function ConfigOption:init()
enabled = enabled,
row_count = row_count,
callback = function(arg)
if self.options[c].args[arg] == "" then
if self.options[c].toggle[arg] == "" then
self.config:onConfigMoreChoose(self.options[c].values, self.options[c].name,
self.options[c].event, arg, self.options[c].name_text, self.options[c].delay_repaint, self.options[c].more_options_param)
end

View File

@@ -195,7 +195,7 @@ function ToggleSwitch:onTapSelect(arg, gev)
end
if gev then
local position = self:calculatePosition(gev)
if self.args[position] ~= "" then
if self.toggle[position] ~= "" then
self:togglePosition(position, true)
else
self:togglePosition(position, false)
@@ -218,7 +218,7 @@ function ToggleSwitch:onTapSelect(arg, gev)
end
--]]
self.callback(self.position)
if self.args[self.position] ~= "" then
if self.toggle[self.position] ~= "" then
self.config:onConfigChoose(self.values, self.name,
self.event, self.args, self.events, self.position, self.delay_repaint)
UIManager:setDirty(self.config, function()
@@ -230,7 +230,7 @@ end
function ToggleSwitch:onHoldSelect(arg, gev)
local position = self:calculatePosition(gev)
if self.args[position] == "" then
if self.toggle[position] == "" then
return true
end
if self.name == "font_fine_tune" then