diff --git a/ReactCommon/cxxreact/JSCExecutor.cpp b/ReactCommon/cxxreact/JSCExecutor.cpp index 5e1aae7ae7..8145f2b6b1 100644 --- a/ReactCommon/cxxreact/JSCExecutor.cpp +++ b/ReactCommon/cxxreact/JSCExecutor.cpp @@ -328,6 +328,11 @@ void JSCExecutor::loadApplicationScript( folly::checkUnixError(fd, "Couldn't open compiled bundle"); SCOPE_EXIT { close(fd); }; sourceCode = JSCreateCompiledSourceCode(fd, jsSourceURL); + + folly::throwOnFail( + sourceCode != nullptr, + "Could not create compiled source code" + ); } else { auto jsScriptBigString = JSBigMmapString::fromOptimizedBundle(bundlePath); if (jsScriptBigString->encoding() != JSBigMmapString::Encoding::Ascii) {