mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Geom: nil guard a few rect methods (#7664)
We've managed to trip a few of those on dimen fields post-init but pre-paintTo in a few weird coner-cases, a point at which dimen is often nil. ConfigDialog: Deal with that very thing in update() Fix #7656
This commit is contained in:
@@ -439,6 +439,14 @@ function ReaderUI:init()
|
||||
-- for _, tzone in ipairs(self._ordered_touch_zones) do
|
||||
-- print(" "..tzone.def.id)
|
||||
-- end
|
||||
|
||||
if ReaderUI.instance == nil then
|
||||
logger.dbg("Spinning up new ReaderUI instance", tostring(self))
|
||||
else
|
||||
-- Should never happen, given what we did above...
|
||||
logger.err("ReaderUI instance mismatch! Opened", tostring(self), "while we still have an existing instance:", tostring(ReaderUI.instance), debug.traceback())
|
||||
end
|
||||
ReaderUI.instance = self
|
||||
end
|
||||
|
||||
function ReaderUI:setLastDirForFileBrowser(dir)
|
||||
@@ -621,14 +629,6 @@ function ReaderUI:doShowReader(file, provider)
|
||||
end
|
||||
|
||||
UIManager:show(reader, "full")
|
||||
|
||||
if ReaderUI.instance == nil then
|
||||
logger.dbg("Spinning up new ReaderUI instance", tostring(reader))
|
||||
else
|
||||
-- Should never happen, given what we did above...
|
||||
logger.warn("ReaderUI instance mismatch! Opened", tostring(reader), "while we still have an existing instance:", tostring(ReaderUI.instance))
|
||||
end
|
||||
ReaderUI.instance = reader
|
||||
end
|
||||
|
||||
-- NOTE: The instance reference used to be stored in a private module variable, hence the getter method.
|
||||
|
||||
Reference in New Issue
Block a user