Commit 7329a2b5 authored by Dan Melnic's avatar Dan Melnic Committed by Facebook Github Bot

Avoid SIGSEGV if getIOExecutor() returns null

Summary: Avoid SIGSEGV if getIOExecutor() returns null

Reviewed By: yfeldblum

Differential Revision: D16859157

fbshipit-source-id: 00c7a45677c61d84a10486f11b4f792093ac2ff5
parent 651dace4
......@@ -114,7 +114,12 @@ void setIOExecutor(std::weak_ptr<IOExecutor> executor) {
}
EventBase* getEventBase() {
return getIOExecutor()->getEventBase();
auto executor = getIOExecutor();
if (FOLLY_LIKELY(!!executor)) {
return executor->getEventBase();
}
return nullptr;
}
} // namespace folly
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment