Skip to content

Commit ec4dc16

Browse files
committed
fix devtools launch crash
1 parent e39b534 commit ec4dc16

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/api/window_bindings.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,11 @@ Window.prototype.toggleKioskMode = function() {
271271

272272
Window.prototype.showDevTools = function(frm, headless) {
273273
var id = '';
274-
if (typeof frm === 'string')
274+
if (typeof frm === 'string') {
275275
id = frm;
276-
else
276+
}else{
277277
this._pending_devtools_jail = frm;
278+
}
278279
CallObjectMethod(this, 'ShowDevTools', [id, Boolean(headless)]);
279280
}
280281

@@ -283,7 +284,7 @@ Window.prototype.__setDevToolsJail = function(id) {
283284
if (id)
284285
frm = this.window.document.getElementById(id);
285286
else
286-
frm = this._pending_devtools_jail;
287+
frm = this._pending_devtools_jail || null;
287288
CallObjectMethod(this, 'setDevToolsJail', frm);
288289
}
289290

0 commit comments

Comments
 (0)