diff --git a/src/client.js b/src/client.js index 7dd219f80..1a3904262 100644 --- a/src/client.js +++ b/src/client.js @@ -3426,7 +3426,7 @@ MatrixClient.prototype._requestTokenFromEndpoint = function(endpoint, params) { if (this.idBaseUrl) { const idServerUrl = url.parse(this.idBaseUrl); - if (idServerUrl.host === null) { + if (!idServerUrl.host) { throw new Error("Invalid ID server URL: " + this.idBaseUrl); } postParams.id_server = idServerUrl.host;