summaryrefslogtreecommitdiff
path: root/Userland/Applications/PDFViewer/PDFViewer.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-18 21:24:46 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-18 21:25:35 +0200
commit076018b74b5dc98462f203a132b4697b6c9e22ff (patch)
tree35e6ee576dedc6308e7c897141aac8fb3f7ea598 /Userland/Applications/PDFViewer/PDFViewer.cpp
parentf8082797694290c09fa32b2480e4eecde452c372 (diff)
downloadserenity-076018b74b5dc98462f203a132b4697b6c9e22ff.zip
PDFViewer: Ignore wheel events when there is no document loaded
Diffstat (limited to 'Userland/Applications/PDFViewer/PDFViewer.cpp')
-rw-r--r--Userland/Applications/PDFViewer/PDFViewer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Applications/PDFViewer/PDFViewer.cpp b/Userland/Applications/PDFViewer/PDFViewer.cpp
index 87902dc39f..c93cc495b2 100644
--- a/Userland/Applications/PDFViewer/PDFViewer.cpp
+++ b/Userland/Applications/PDFViewer/PDFViewer.cpp
@@ -72,6 +72,9 @@ void PDFViewer::paint_event(GUI::PaintEvent& event)
void PDFViewer::mousewheel_event(GUI::MouseEvent& event)
{
+ if (!m_document)
+ return;
+
bool scrolled_down = event.wheel_delta() > 0;
if (event.ctrl()) {