Merge pull request #153 from kiwix/fix-crash-non-existing-file

Fix crash when trying to open non existing file
This commit is contained in:
Matthieu Gautier 2019-05-16 17:31:04 +02:00 committed by GitHub
commit 38037bbcdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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