fix(ui): fix potential nullptr dereferencing (fixes #1101)

This commit is contained in:
Oleg Shparber 2019-05-10 00:45:35 -04:00
parent 0b2657c44a
commit c46f389512

View File

@ -62,10 +62,10 @@ BrowserTab::BrowserTab(QWidget *parent)
Registry::Docset *docset = Core::Application::instance()->docsetRegistry()->docset(name); Registry::Docset *docset = Core::Application::instance()->docsetRegistry()->docset(name);
if (docset) { if (docset) {
m_searchSidebar->pageTocModel()->setResults(docset->relatedLinks(url)); searchSidebar()->pageTocModel()->setResults(docset->relatedLinks(url));
m_webControl->setJavaScriptEnabled(docset->isJavaScriptEnabled()); m_webControl->setJavaScriptEnabled(docset->isJavaScriptEnabled());
} else { } else {
m_searchSidebar->pageTocModel()->setResults(); searchSidebar()->pageTocModel()->setResults();
// Always enable JS outside of docsets. // Always enable JS outside of docsets.
m_webControl->setJavaScriptEnabled(true); m_webControl->setJavaScriptEnabled(true);
} }