Index: chrome/renderer/safe_browsing/phishing_dom_feature_extractor.cc |
diff --git a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.cc b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.cc |
index 4e1ef0bebc328bcec260c2b09dab9d8b99dad7b5..641017996263c13a34e2616c6f54876b1963c8f3 100644 |
--- a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.cc |
+++ b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.cc |
@@ -390,8 +390,10 @@ blink::WebDocument PhishingDOMFeatureExtractor::GetNextDocument() { |
// Advance to the next frame that contains a document, with no wrapping. |
if (frame) { |
for (frame = frame->TraverseNext(); frame; frame = frame->TraverseNext()) { |
- if (!frame->GetDocument().IsNull()) { |
- return frame->GetDocument(); |
+ // TODO(dcheng): Verify if the WebDocument::IsNull check is really needed. |
+ if (frame->IsWebLocalFrame() && |
+ !frame->ToWebLocalFrame()->GetDocument().IsNull()) { |
+ return frame->ToWebLocalFrame()->GetDocument(); |
} |
} |
} else { |