From dbc49f51ddaaa3241f29ccfab028f9d7e6926c58 Mon Sep 17 00:00:00 2001 From: Daniel Scalzi Date: Fri, 28 Aug 2020 17:39:29 -0400 Subject: [PATCH] Make sure to return on rejection. --- package-lock.json | 6 +++--- package.json | 2 +- src/common/mojang/net/ServerStatusAPI.ts | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index eee2743..0f6afe2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7698,9 +7698,9 @@ "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" }, "mocha": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.1.2.tgz", - "integrity": "sha512-I8FRAcuACNMLQn3lS4qeWLxXqLvGf6r2CaLstDpZmMUUSmvW6Cnm1AuHxgbc7ctZVRcfwspCRbDHymPsi3dkJw==", + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.1.3.tgz", + "integrity": "sha512-ZbaYib4hT4PpF4bdSO2DohooKXIn4lDeiYqB+vTmCdr6l2woW0b6H3pf5x4sM5nwQMru9RvjjHYWVGltR50ZBw==", "dev": true, "requires": { "ansi-colors": "4.1.1", diff --git a/package.json b/package.json index f01ef52..01e12f7 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "eslint": "^7.7.0", "eslint-plugin-react": "^7.20.6", "helios-distribution-types": "1.0.0-pre.1", - "mocha": "^8.1.2", + "mocha": "^8.1.3", "nock": "^13.0.4", "react": "^16.13.0", "react-dom": "^16.13.0", diff --git a/src/common/mojang/net/ServerStatusAPI.ts b/src/common/mojang/net/ServerStatusAPI.ts index 98895d9..abbc3f7 100644 --- a/src/common/mojang/net/ServerStatusAPI.ts +++ b/src/common/mojang/net/ServerStatusAPI.ts @@ -123,6 +123,7 @@ export function getServerStatus(protocol: number, address: string, port = 25565) if(iterations > maxTries) { socket.destroy() reject(new Error(`Data read from ${address}:${port} exceeded ${maxTries} iterations, closing connection.`)) + return } ++iterations