Skip to content

Commit

Permalink
fix(chromium): prevent errors when frame does not exist when detachin…
Browse files Browse the repository at this point in the history
…g 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
  • Loading branch information
cnishina committed Apr 15, 2020
1 parent 451a6b7 commit 3167f2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/chromium/crPage.ts
Expand Up @@ -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);
}
Expand Down

0 comments on commit 3167f2d

Please sign in to comment.