From fc7f0bacf1776ecd44d241b191cad3c79e65617b Mon Sep 17 00:00:00 2001 From: Stephane Albert Date: Thu, 14 Jul 2022 11:46:25 +0200 Subject: [PATCH] [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. --- frontend/device/pocketbook/device.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/device/pocketbook/device.lua b/frontend/device/pocketbook/device.lua index 63542c8e5..2bc58684c 100644 --- a/frontend/device/pocketbook/device.lua +++ b/frontend/device/pocketbook/device.lua @@ -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