ext/common/sunscraperworker.cpp in sunscraper-1.2.0.beta1 vs ext/common/sunscraperworker.cpp in sunscraper-1.2.0.pre1
- old
+ new
@@ -84,10 +84,13 @@
{
QWebFrame *origin = static_cast<QWebFrame *>(QObject::sender());
QWebPage *page = origin->page();
unsigned queryId = m_webPages.key(page, 0);
- Q_ASSERT(queryId != 0);
+
+ /* Called on an already finalized page in the process of finalization. */
+ if(queryId == 0)
+ return;
SunscraperProxy *proxy = new SunscraperProxy(page, queryId);
connect(proxy, SIGNAL(finished(uint)), this, SLOT(onFinish(uint)));
origin->addToJavaScriptWindowObject("Sunscraper", proxy, QScriptEngine::QtOwnership);