Skip to content

Commit

Permalink
Firefox: Fixing closed window handling in FF45
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Feb 10, 2016
1 parent 0f45bdd commit 9c2f12d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions javascript/firefox-driver/js/nsCommandProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,16 @@ nsCommandProcessor.prototype.execute = function(jsonCommandString,
return;
}

var contentWindow = sessionWindow.getBrowser().contentWindow;
if (!contentWindow) {
response.sendError(new WebDriverError(bot.ErrorCode.NO_SUCH_WINDOW,
try {
var contentWindow = sessionWindow.getBrowser().contentWindow;
if (!contentWindow) {
response.sendError(new WebDriverError(bot.ErrorCode.NO_SUCH_WINDOW,
'Window not found. The browser window may have been closed.'));
return;
}
} catch (ff45) {
response.sendError(new WebDriverError(bot.ErrorCode.NO_SUCH_WINDOW,
'Window not found. The browser window may have been closed.'));
return;
}

Expand Down

0 comments on commit 9c2f12d

Please sign in to comment.