diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc index b633af1b1ab81..fe8b3cc1a9588 100644 --- a/shell/browser/api/electron_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -526,7 +526,7 @@ bool NotificationCallbackWrapper( const ProcessSingleton::NotificationAckCallback& ack_callback) { // Make sure the callback is called after app gets ready. if (Browser::Get()->is_ready()) { - callback.Run(cmd, cwd, additional_data, ack_callback); + callback.Run(cmd, cwd, std::move(additional_data), ack_callback); } else { scoped_refptr task_runner( base::ThreadTaskRunnerHandle::Get()); @@ -1084,9 +1084,14 @@ void App::OnFirstInstanceAck( v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); v8::Locker locker(isolate); v8::HandleScope handle_scope(isolate); - v8::Local data_to_send; + base::Value data_to_send; if (first_instance_data) { - data_to_send = DeserializeV8Value(isolate, *first_instance_data); + // Don't send back the local directly, because it might be empty + v8::Local data_local; + data_local = DeserializeV8Value(isolate, *first_instance_data); + if (!data_local.IsEmpty()) { + gin::ConvertFromV8(isolate, data_local, &data_to_send); + } } Emit("first-instance-ack", data_to_send); }