diff --git a/services/timer/src/timer_manager.cpp b/services/timer/src/timer_manager.cpp index 35aa98fa4808785cc7beae44385e9cf8d97ec3c2..fd67fa99c4ff11dda0b6cf0b58b533102412d1a4 100644 --- a/services/timer/src/timer_manager.cpp +++ b/services/timer/src/timer_manager.cpp @@ -1222,7 +1222,7 @@ void TimerManager::DecRunningLockRef() count_ -= 1; } TIME_HILOGI(TIME_MODULE_SERVICE, "count_=%{public}d", count_); - if (count_ == 0) { + if (count_ == 0 && runningLock_ != nullptr) { runningLock_->UnLock(); TIME_HILOGI(TIME_MODULE_SERVICE, "runninglock unlock"); }