Fix possible crash with config panel when engine switched (#3761)

Reading an epub file with Mupdf would show 6 items in bottom
config panel. Reading it with crengine would show only 5.
A crash would happen if we were on the 6th when leaving MuPDF,
and later opening config panel with crengine.
pull/3764/head
poire-z 6 years ago committed by Frans de Jonge
parent 152e17fbe3
commit 0a4fb89239

@ -118,7 +118,11 @@ end
function ReaderConfig:onReadSettings(config)
self.configurable:loadSettings(config, self.options.prefix.."_")
self.last_panel_index = config:readSetting("config_panel_index") or 1
local config_panel_index = config:readSetting("config_panel_index")
if config_panel_index then
config_panel_index = math.min(config_panel_index, #self.options)
end
self.last_panel_index = config_panel_index or 1
end
function ReaderConfig:onSaveSettings()

Loading…
Cancel
Save