Skip to content

Commit 0ac09d0

Browse files
wejendorpjleyba
authored andcommitted
fix: add until.urlContains null value check (SeleniumHQ#5933)
`driver.getCurrentUrl()` can return `null` in some cases, which causes a `TypeError` instead of continuing to retry for the expected time.
1 parent 67b6e30 commit 0ac09d0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • javascript/node/selenium-webdriver/lib

‎javascript/node/selenium-webdriver/lib/until.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ exports.urlContains = function urlContains(substrUrl) {
205205
'for URL to contain ' + JSON.stringify(substrUrl),
206206
function(driver) {
207207
return driver.getCurrentUrl().then(function(url) {
208-
return url.indexOf(substrUrl) !== -1;
208+
return url && url.indexOf(substrUrl) !== -1;
209209
});
210210
});
211211
};

0 commit comments

Comments
 (0)