From 50f3aa252f8adbcb75f097feddd104131ff2333e Mon Sep 17 00:00:00 2001 From: poire-z Date: Thu, 10 Oct 2019 12:47:02 +0200 Subject: [PATCH] cre progress meter: avoid some warning with unit tests (#5464) Quick fix for some warnings shown in unit tests output, see https://github.com/koreader/koreader/pull/5406#issuecomment-540059452 --- frontend/apps/reader/modules/readerrolling.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/apps/reader/modules/readerrolling.lua b/frontend/apps/reader/modules/readerrolling.lua index 544a36777..7ac99689c 100644 --- a/frontend/apps/reader/modules/readerrolling.lua +++ b/frontend/apps/reader/modules/readerrolling.lua @@ -997,7 +997,9 @@ local ENGINE_PROGRESS_INITIAL_DELAY = TimeVal:new{ sec = 2 } local ENGINE_PROGRESS_UPDATE_DELAY = TimeVal:new{ usec = 500000 } function ReaderRolling:showEngineProgress(percent) - if G_reader_settings:isFalse("cre_show_progress") then + if G_reader_settings and G_reader_settings:isFalse("cre_show_progress") then + -- (G_reader_settings might not be available when this is called + -- in the context of unit tests.) -- This may slow things down too much with SDL over SSH, -- so allow disabling it. return