From f22dfa3efb76f95a579fbba51877eab2c4b1bcff Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Wed, 16 Nov 2016 15:08:37 -0800 Subject: [PATCH] Make Bytecode Header errors non-fatal Reviewed By: michalgr Differential Revision: D4182575 fbshipit-source-id: 1e7c229bb6d0bdbfdfc01e93af53441ba2cba9f9 --- ReactCommon/cxxreact/JSCExecutor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ReactCommon/cxxreact/JSCExecutor.cpp b/ReactCommon/cxxreact/JSCExecutor.cpp index 5e1aae7ae..8145f2b6b 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) {