Browse Source

PDFViewer: Ignore wheel events when there is no document loaded

Andreas Kling 4 years ago
parent
commit
076018b74b
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Userland/Applications/PDFViewer/PDFViewer.cpp

+ 3 - 0
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()) {