File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments