Skip to content

Commit

Permalink
Fixing error code returned by xpath finder if the document is lot loa…
Browse files Browse the repository at this point in the history
…ded yet
  • Loading branch information
barancev committed Mar 16, 2015
1 parent d920111 commit bb13f6d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions javascript/atoms/locators/xpath.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ bot.locators.xpath.DEFAULT_RESOLVER_ = (function() {
bot.locators.xpath.evaluate_ = function(node, path, resultType) {
var doc = goog.dom.getOwnerDocument(node);

if (!doc.documentElement) {
// document is not loaded yet
return null;
}

// Let the wgxpath library be compiled away unless we are on IE or Android.
// TODO: Restrict this to just IE when we drop support for Froyo.
if (goog.userAgent.IE || goog.userAgent.product.ANDROID) {
Expand Down

0 comments on commit bb13f6d

Please sign in to comment.