diff --git a/src/ray/core_worker/core_worker.cc b/src/ray/core_worker/core_worker.cc index 877085d8f..fcca76fa6 100644 --- a/src/ray/core_worker/core_worker.cc +++ b/src/ray/core_worker/core_worker.cc @@ -426,7 +426,11 @@ CoreWorker::CoreWorker(const CoreWorkerOptions &options, const WorkerID &worker_ [this](const RayObject &obj) { // Run this on the event loop to avoid calling back into the language runtime // from the middle of user operations. - io_service_.post([this, obj]() { options_.unhandled_exception_handler(obj); }); + io_service_.post([this, obj]() { + if (options_.unhandled_exception_handler != nullptr) { + options_.unhandled_exception_handler(obj); + } + }); })); auto check_node_alive_fn = [this](const NodeID &node_id) {