Commit 116871b1 authored by kenrb@chromium.org's avatar kenrb@chromium.org

Check for NULL after Frame lookup in findFrameByName

This function was crashing if the FrameTree name lookup failed to find
a matching frame.

TBR=japhet@chromium.org
BUG=383845

Review URL: https://codereview.chromium.org/331633004

git-svn-id: svn://svn.chromium.org/blink/trunk@176058 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d091f908
...@@ -2489,7 +2489,7 @@ WebFrame* WebViewImpl::findFrameByName( ...@@ -2489,7 +2489,7 @@ WebFrame* WebViewImpl::findFrameByName(
relativeToFrame = mainFrame(); relativeToFrame = mainFrame();
Frame* frame = toWebLocalFrameImpl(relativeToFrame)->frame(); Frame* frame = toWebLocalFrameImpl(relativeToFrame)->frame();
frame = frame->tree().find(name); frame = frame->tree().find(name);
if (!frame->isLocalFrame()) if (!frame || !frame->isLocalFrame())
return 0; return 0;
return WebLocalFrameImpl::fromFrame(toLocalFrame(frame)); return WebLocalFrameImpl::fromFrame(toLocalFrame(frame));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment