From fcba24c1195df051fd4399ff2a769cfabfe1fec0 Mon Sep 17 00:00:00 2001 From: luddens Date: Wed, 15 May 2019 10:46:29 +0200 Subject: [PATCH] Fix crash when trying to open non existing file if the reader is null because the file doesn't exist, it returns --- src/webview.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/webview.cpp b/src/webview.cpp index e598a02..ecfb769 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -43,6 +43,8 @@ void WebView::onUrlChanged(const QUrl& url) { emit zimIdChanged(m_currentZimId); auto app = KiwixApp::instance(); auto reader = app->getLibrary()->getReader(m_currentZimId); + if (!reader) + return; std::string favicon, _mimetype; reader->getFavicon(favicon, _mimetype); QPixmap pixmap;