diff --git a/presto-native-execution/presto_cpp/main/http/HttpClient.cpp b/presto-native-execution/presto_cpp/main/http/HttpClient.cpp index 8ff3e69f2b147..c889d8990fca7 100644 --- a/presto-native-execution/presto_cpp/main/http/HttpClient.cpp +++ b/presto-native-execution/presto_cpp/main/http/HttpClient.cpp @@ -531,7 +531,7 @@ folly::SemiFuture> HttpClient::sendRequest( sendRequest(std::move(responseHandler)); }; - if (delayMs > 0) { + if (delayMs > 0 && eventBase_ != nullptr) { // schedule() is expected to be run in the event base thread eventBase_->runInEventBaseThread([=]() { eventBase_->schedule(sendCb, std::chrono::milliseconds(delayMs));