Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: content/renderer/mojo_bindings_controller.cc

Issue 2093423005: Fix nullptr dereference in MojoBindingsController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/mojo_bindings_controller.cc
diff --git a/content/renderer/mojo_bindings_controller.cc b/content/renderer/mojo_bindings_controller.cc
index 56cf602c0c39c83ba24d9d2a6dfcd23af4d509dc..99fdf2aa69b948ae444f421693873a547980fb7f 100644
--- a/content/renderer/mojo_bindings_controller.cc
+++ b/content/renderer/mojo_bindings_controller.cc
@@ -38,6 +38,8 @@ MojoBindingsController::~MojoBindingsController() {
void MojoBindingsController::CreateContextState() {
v8::HandleScope handle_scope(blink::mainThreadIsolate());
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
+ if (!frame)
+ return;
v8::Local<v8::Context> context = frame->mainWorldScriptContext();
gin::PerContextData* context_data = gin::PerContextData::From(context);
MojoContextStateData* data = new MojoContextStateData;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698