Skip to content

Commit 154e183

Browse files
Ashok Menonfacebook-github-bot
authored andcommitted
Fixing RN Debugger
Reviewed By: cwdick, javache Differential Revision: D4409257 fbshipit-source-id: 062c798d1a1c9ad90884599ed262412c1dd51359
1 parent 545072b commit 154e183

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

ReactCommon/cxxreact/Instance.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,16 @@ void Instance::loadScriptFromFile(const std::string& filename,
7373
"fileName", filename);
7474

7575
std::unique_ptr<const JSBigFileString> script;
76-
RecoverableError::runRethrowingAsRecoverable<std::system_error>(
77-
[&filename, &script]() {
78-
script = JSBigFileString::fromPath(filename);
79-
});
76+
77+
// This function can be called in order to change the Bridge's Source URL.
78+
// In that case, the filename will be empty, and we should not attempt to
79+
// load it.
80+
if (!filename.empty()) {
81+
RecoverableError::runRethrowingAsRecoverable<std::system_error>(
82+
[&filename, &script]() {
83+
script = JSBigFileString::fromPath(filename);
84+
});
85+
}
8086

8187
nativeToJsBridge_->loadApplication(nullptr, std::move(script), sourceURL);
8288
}

0 commit comments

Comments
 (0)