Skip to content

Commit

Permalink
Firefox: Fixing null pointer exception if a page is not fully loaded. F…
Browse files Browse the repository at this point in the history
…ixes #1723
  • Loading branch information
barancev committed Mar 2, 2016
1 parent c277050 commit 71010a6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions javascript/firefox-driver/js/firefoxDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1172,11 +1172,9 @@ FirefoxDriver.prototype.mouseDoubleClick = function(respond, parameters) {
FirefoxDriver.prototype.sendKeysToActiveElement = function(respond, parameters) {
Utils.installWindowCloseListener(respond);

var currentlyActiveElement = Utils.getActiveElement(respond.session.getDocument());

var useElement = currentlyActiveElement;
var tagName = useElement.tagName.toLowerCase();
if (tagName == 'body' && useElement.ownerDocument.defaultView.frameElement) {
var useElement = Utils.getActiveElement(respond.session.getDocument());
if (useElement && useElement.tagName.toLowerCase() == 'body'
&& useElement.ownerDocument.defaultView.frameElement) {
useElement.ownerDocument.defaultView.focus();

// Turns out, this is what we should be using as the target
Expand Down

0 comments on commit 71010a6

Please sign in to comment.