Fix crash when trying to open non existing file

if the reader is null because the file doesn't exist, it returns
This commit is contained in:
luddens 2019-05-15 10:46:29 +02:00
parent 2adc00074e
commit fcba24c119

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;