mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[PocketBook] fix: Crash loading file extensions (#9327)
In some versions of the /ebrmain/config/extensions.cfg file there is a comment #ebrcfg. This will not match the regex and crashes koreader as the table is empty. Add a check to ensure the table is not empty while reading extensions from the default file.
This commit is contained in:
@@ -296,7 +296,9 @@ function PocketBook:associateFileExtensions(assoc)
|
||||
local info = {}
|
||||
for l in io.lines("/ebrmain/config/extensions.cfg") do
|
||||
local m = { l:match("^([^:]*):([^:]*):([^:]*):([^:]*):(.*)") }
|
||||
info[m[1]] = m
|
||||
if #m > 0 then
|
||||
info[m[1]] = m
|
||||
end
|
||||
end
|
||||
local res = {"#koreader"}
|
||||
for k,v in pairs(assoc) do
|
||||
|
||||
Reference in New Issue
Block a user