fix autoversion

This commit is contained in:
Romain Beaumont 2018-01-26 13:09:12 +01:00 committed by GitHub
parent 834c8785af
commit 0c097d6d63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,7 +11,8 @@ module.exports = function(client, options) {
debug('pinging',options.host);
// TODO: use 0xfe ping instead for better compatibility/performance? https://github.com/deathcap/node-minecraft-ping
ping(options, function(err, response) {
client.emit('error',err);
if(err)
client.emit('error',err);
debug('ping response',response);
// TODO: could also use ping pre-connect to save description, type, max players, etc.
const motd = response.description;