Dispatcher: fix possible crash when no document (#7716)

pull/7725/head
zwim 3 years ago committed by GitHub
parent 6e1950676a
commit 78fdce8e9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -617,6 +617,8 @@ arguments are:
function Dispatcher:execute(ui, settings, gesture)
for k, v in pairs(settings) do
if settingsList[k] ~= nil and (settingsList[k].conditions == nil or settingsList[k].conditions == true) then
-- Be sure we don't send a document setting event if there's not yet or no longer a document
if ui.document or (not settingsList[k].paging and not settingsList[k].rolling) then
if settingsList[k].category == "none" then
if settingsList[k].arg ~= nil then
ui:handleEvent(Event:new(settingsList[k].event, settingsList[k].arg))
@ -651,5 +653,6 @@ function Dispatcher:execute(ui, settings, gesture)
end
end
end
end
return Dispatcher

Loading…
Cancel
Save