Fixed some potential crashes when encountering scraper errors

This commit is contained in:
Leon Styhre 2024-07-17 12:57:05 +02:00
parent 8ca231ceb4
commit 085b3da8e0

View file

@ -865,7 +865,8 @@ void GuiScraperSearch::update(int deltaTime)
}
else if (mMDRetrieveURLsHandle->status() == ASYNC_ERROR) {
onSearchError(mMDRetrieveURLsHandle->getStatusString(),
mMDRetrieveURLsHandle->getRetry(), mSearchHandle->getFatalError());
mMDRetrieveURLsHandle->getRetry(),
(mSearchHandle != nullptr ? mSearchHandle->getFatalError() : false));
mMDRetrieveURLsHandle.reset();
}
}
@ -923,7 +924,7 @@ void GuiScraperSearch::update(int deltaTime)
}
else if (mMDResolveHandle->status() == ASYNC_ERROR) {
onSearchError(mMDResolveHandle->getStatusString(), mMDResolveHandle->getRetry(),
mSearchHandle->getFatalError());
(mSearchHandle != nullptr ? mSearchHandle->getFatalError() : false));
mMDResolveHandle.reset();
}
}
@ -952,7 +953,8 @@ void GuiScraperSearch::updateThumbnail()
else {
mResultThumbnail->setImage("");
onSearchError("Error downloading thumbnail:\n " + it->second->getErrorMsg(), true,
mSearchHandle->getFatalError(), it->second->status());
(mSearchHandle != nullptr ? mSearchHandle->getFatalError() : false),
it->second->status());
}
mThumbnailReqMap.erase(it);