mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user