diff --git a/javascript/node/selenium-webdriver/lib/until.js b/javascript/node/selenium-webdriver/lib/until.js
index <HASH>..<HASH> 100644
--- a/javascript/node/selenium-webdriver/lib/until.js
+++ b/javascript/node/selenium-webdriver/lib/until.js
@@ -205,7 +205,7 @@ exports.urlContains = function urlContains(substrUrl) {
       'for URL to contain ' + JSON.stringify(substrUrl),
       function(driver) {
         return driver.getCurrentUrl().then(function(url) {
-          return url.indexOf(substrUrl) !== -1;
+          return url && url.indexOf(substrUrl) !== -1;
         });
       });
 };
fix: add until.urlContains null value check (#<I>)

`driver.getCurrentUrl()` can return `null` in some cases, which causes

a `TypeError` instead of continuing to retry for the expected time.