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

Unified Diff: chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc

Issue 1139193003: Speculative fix for ChromeWebViewGuestDelegate crash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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: chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc
diff --git a/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc b/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc
index 170a56111249dc4fab8ee22858a3f9603cdbaa29..3b8fe542d34c5d51bbb4877f675afe4802e9e4c5 100644
--- a/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc
+++ b/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc
@@ -50,6 +50,11 @@ bool ChromeWebViewGuestDelegate::HandleContextMenu(
DCHECK(menu_delegate);
pending_menu_ = menu_delegate->BuildMenu(guest_web_contents(), params);
+ // It's possible for the returned menu to be null, so early out to avoid
+ // a crash. TODO(wjmaclean): find out why it's possible for this to happen
+ // in the first place, and if it's an error.
+ if (!pending_menu_)
+ return false;
// Pass it to embedder.
int request_id = ++pending_context_menu_request_id_;
« 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