mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-12-19 16:33:04 +03:00
Fixed Tools.domainAvailable method
This commit is contained in:
parent
701efddd72
commit
4befc9faa0
1 changed files with 8 additions and 2 deletions
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue