Skip to content

Commit

Permalink
Don't crash if MessageSync fails
Browse files Browse the repository at this point in the history
  • Loading branch information
eiz committed Mar 30, 2020
1 parent ad85009 commit cdee590
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shell/renderer/api/atom_api_renderer_ipc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ class IPCRenderer : public mate::Wrappable<IPCRenderer> {

electron_browser_ptr_->MessageSync(internal, channel, std::move(arguments),
&result);
return std::move(result.GetList().at(0));
return result.GetList().size() > 0 ? std::move(result.GetList().at(0))
: base::Value();
}

private:
Expand Down

0 comments on commit cdee590

Please sign in to comment.