diff --git a/frameworks/bootanimation/src/boot_videoplayer.cpp b/frameworks/bootanimation/src/boot_videoplayer.cpp index 86bc6939e2..7cd848948f 100644 --- a/frameworks/bootanimation/src/boot_videoplayer.cpp +++ b/frameworks/bootanimation/src/boot_videoplayer.cpp @@ -52,6 +52,10 @@ bool BootVideoPlayer::PlayVideo() if (mediaPlayer_ == nullptr) { mediaPlayer_ = Media::PlayerFactory::CreatePlayer(); } + if (mediaPlayer_ == nullptr) { + LOGE("PlayVideo SetPlayerCallback fail, mediaPlayer_ is nullptr"); + return false; + } std::shared_ptr cb = std::make_shared(shared_from_this()); int32_t ret = mediaPlayer_->SetPlayerCallback(cb); if (ret != 0) {