From ef2f2bd204c35ed5e289e28b59f7135f5744319f Mon Sep 17 00:00:00 2001 From: Nick Krecklow Date: Tue, 21 Apr 2020 18:02:29 -0500 Subject: [PATCH] fix #getNextProtocolVersion crash from Bedrock having undefined versions --- lib/servers.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/servers.js b/lib/servers.js index 8436041..c1e911c 100644 --- a/lib/servers.js +++ b/lib/servers.js @@ -249,6 +249,13 @@ class ServerRegistration { } getNextProtocolVersion () { + // Minecraft Bedrock Edition does not have protocol versions + if (this.data.type === 'PE') { + return { + protocolId: 0, + protocolIndex: 0 + } + } const protocolVersions = minecraftVersions[this.data.type] if (typeof this._nextProtocolIndex === 'undefined' || this._nextProtocolIndex + 1 >= protocolVersions.length) { this._nextProtocolIndex = 0