fix(chromium): prevent errors when frame does not exist when detaching from oopif (#1767)

When navigating away from the page loaded in `goto`, the frame no longer
exists. Page.removeFrameSession is called and throws an error. Instead
of calling the helper.assert method, moved removeChildFramesRecursively
into a conditional.

closes #1762
This commit is contained in:
Craig Nishina 2020-04-14 19:01:01 -07:00 committed by GitHub
parent 451a6b7904
commit 3167f2d34c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,8 +104,8 @@ export class CRPage implements PageDelegate {
return;
// Frame id equals target id.
const frame = this._page._frameManager.frame(targetId);
assert(frame);
this._page._frameManager.removeChildFramesRecursively(frame);
if (frame)
this._page._frameManager.removeChildFramesRecursively(frame);
frameSession.dispose();
this._sessions.delete(targetId);
}