From 4befc9faa0909dea0aff46cd70cd35da305b08a9 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Tue, 14 Dec 2021 19:59:34 +0200 Subject: [PATCH] Fixed Tools.domainAvailable method --- src/ts/lib/Tools.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ts/lib/Tools.ts b/src/ts/lib/Tools.ts index 77ada55..395628c 100644 --- a/src/ts/lib/Tools.ts +++ b/src/ts/lib/Tools.ts @@ -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'); }); });