Add an extra check to follow r15565.

This is another speculative crash fix.
The crash report says Frame::document() causes crash.
So this adds a guard for that.

BUG=268598
R=tkent@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@155738 bbb929c8-8fbe-4397-9dbb-9b2b20218538