Fixed Tools.domainAvailable method

This commit is contained in:
Observer KRypt0n_ 2021-12-14 19:59:34 +02:00
parent 701efddd72
commit 4befc9faa0
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA

View file

@ -113,8 +113,14 @@ export default class Tools
dns.lookup(uri, (error: any, address: string, family: any) => {
// console.log(`${uri} -> ${address}`);
if (error.toString().startsWith('Error: getaddrinfo ENOTFOUND')) resolve(true);
else if (error) reject(error);
if (error)
{
if (error.toString().startsWith('Error: getaddrinfo ENOTFOUND'))
resolve(true);
else reject(error);
}
else resolve(address == '0.0.0.0');
});
});