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

Unified Diff: content/renderer/context_menu_params_builder.cc

Issue 474163002: Fix crash in WebNode::isLink(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/context_menu_params_builder.cc
diff --git a/content/renderer/context_menu_params_builder.cc b/content/renderer/context_menu_params_builder.cc
index 0d53dac225eefaf56f29cb59b620a63e389a09c6..63dcd4d1e7b6b3c5b903b9dac8906f4e88882da2 100644
--- a/content/renderer/context_menu_params_builder.cc
+++ b/content/renderer/context_menu_params_builder.cc
@@ -58,7 +58,7 @@ ContextMenuParams ContextMenuParamsBuilder::Build(
if (!params.link_url.is_empty()) {
blink::WebNode selectedNode = DomUtils::ExtractParentAnchorNode(data.node);
blink::WebElement selectedElement = selectedNode.to<blink::WebElement>();
- if (selectedNode.isLink() && !selectedElement.isNull()) {
+ if (!selectedElement.isNull() && selectedNode.isLink()) {
params.link_text = selectedElement.innerText();
} else {
LOG(ERROR) << "Creating a ContextMenuParams for a node that has a link"
« 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