mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
Merge pull request #1420 from shenlebantongying/fix-qrcx-fail-crash
fix: a crash when qrcx:// fails.
This commit is contained in:
commit
ebce607634
|
@ -12,7 +12,12 @@ void ResourceSchemeHandler::requestStarted( QWebEngineUrlRequestJob * requestJob
|
||||||
const QMimeType mineType = db.mimeTypeForUrl( url );
|
const QMimeType mineType = db.mimeTypeForUrl( url );
|
||||||
const sptr< Dictionary::DataRequest > reply = this->mManager.getResource( url, content_type );
|
const sptr< Dictionary::DataRequest > reply = this->mManager.getResource( url, content_type );
|
||||||
content_type = mineType.name();
|
content_type = mineType.name();
|
||||||
if ( reply->isFinished() ) {
|
|
||||||
|
if ( reply == nullptr ) {
|
||||||
|
qDebug() << "Resource failed to load: " << url.toString();
|
||||||
|
requestJob->fail( QWebEngineUrlRequestJob::RequestFailed );
|
||||||
|
}
|
||||||
|
else if ( reply->isFinished() ) {
|
||||||
replyJob( reply, requestJob, content_type );
|
replyJob( reply, requestJob, content_type );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue