diff --git a/services/backup/src/Reactors/server/PullBackupReactor.cpp b/services/backup/src/Reactors/server/PullBackupReactor.cpp --- a/services/backup/src/Reactors/server/PullBackupReactor.cpp +++ b/services/backup/src/Reactors/server/PullBackupReactor.cpp @@ -180,15 +180,17 @@ void PullBackupReactor::terminateCallback() { const std::lock_guard lock(this->reactorStateMutex); std::unique_lock lockGet(this->blobGetDoneCVMutex); - if (this->getReactor->getStatusHolder()->state != ReactorState::DONE) { - this->blobGetDoneCV.wait(lockGet); - } - if (this->getReactor->getStatusHolder()->state != ReactorState::DONE) { - throw std::runtime_error("get reactor has not been terminated properly"); - } - if (!this->getReactor->getStatusHolder()->getStatus().ok()) { - throw std::runtime_error( - this->getReactor->getStatusHolder()->getStatus().error_message()); + if (this->getReactor != nullptr) { + if (this->getReactor->getStatusHolder()->state != ReactorState::DONE) { + this->blobGetDoneCV.wait(lockGet); + } + if (this->getReactor->getStatusHolder()->state != ReactorState::DONE) { + throw std::runtime_error("get reactor has not been terminated properly"); + } + if (!this->getReactor->getStatusHolder()->getStatus().ok()) { + throw std::runtime_error( + this->getReactor->getStatusHolder()->getStatus().error_message()); + } } if (!this->getStatusHolder()->getStatus().ok()) { throw std::runtime_error(