mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
fix(reader): prevent crash when changing download folder
Check if `updateShortcut` is defined on `folder_shortcuts` before calling it. Older versions of KOReader do not have this method, which causes a fatal crash when selecting a custom download folder. Closes #517
This commit is contained in:
@@ -156,7 +156,8 @@ function CatalogDownload.install(Catalog)
|
||||
require("ui/downloadmgr"):new{
|
||||
onConfirm = function(path)
|
||||
logger.dbg("BookOrbit: download folder set to", path)
|
||||
if self._manager and self._manager.ui and self._manager.ui.folder_shortcuts then
|
||||
if self._manager and self._manager.ui and self._manager.ui.folder_shortcuts
|
||||
and self._manager.ui.folder_shortcuts.updateShortcut then
|
||||
self._manager.ui.folder_shortcuts:updateShortcut("download_dir", path)
|
||||
end
|
||||
G_reader_settings:saveSetting("download_dir", path)
|
||||
|
||||
Reference in New Issue
Block a user