From 3dc3aa3d33c82d3c2dbb2fa3988d6e7ac3339783 Mon Sep 17 00:00:00 2001 From: Maroxy Date: Sat, 11 Dec 2021 22:14:46 +0100 Subject: [PATCH] Fix telemetry breaking if ENOTFOUND --- src/ts/lib/Tools.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ts/lib/Tools.ts b/src/ts/lib/Tools.ts index 7174d3b..77ada55 100644 --- a/src/ts/lib/Tools.ts +++ b/src/ts/lib/Tools.ts @@ -113,9 +113,8 @@ export default class Tools dns.lookup(uri, (error: any, address: string, family: any) => { // console.log(`${uri} -> ${address}`); - if (error) - reject(error); - + if (error.toString().startsWith('Error: getaddrinfo ENOTFOUND')) resolve(true); + else if (error) reject(error); else resolve(address == '0.0.0.0'); }); });