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:
NiLuJe
2021-05-13 13:05:05 +02:00
committed by GitHub
parent a3575134af
commit bb65a69193
6 changed files with 47 additions and 27 deletions

View File

@@ -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.