!3461 修正空指针引用

Merge pull request !3461 from 道常参商/master
This commit is contained in:
openharmony_ci 2024-09-23 14:27:27 +00:00 committed by Gitee
commit 007b6e4e03
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -312,7 +312,7 @@ void Downloader::Pause(bool isAsync)
void Downloader::Cancel()
{
MEDIA_LOG_I("Cancel Begin");
if (currentRequest_->retryTimes_ > 0) {
if (currentRequest_ != nullptr && currentRequest_->retryTimes_ > 0) {
currentRequest_->retryTimes_ = 0;
}
requestQue_->SetActive(false, true);