From 2509417c08f5505d1f50b1a5d9ea257520a1e582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Dahlgren?= Date: Sat, 31 Oct 2015 14:35:50 +0100 Subject: [PATCH] Make sure instance is running before applying new state --- lib/server.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/server.js b/lib/server.js index b9f3469..f2a4430 100644 --- a/lib/server.js +++ b/lib/server.js @@ -56,6 +56,10 @@ Server.prototype.update = function (options) { }; Server.prototype.queryStatus = function() { + if (!this.instance) { + return; + } + var self = this; Gamedig.query( { @@ -64,6 +68,10 @@ Server.prototype.queryStatus = function() { port: self.port, }, function(state) { + if (!self.instance) { + return; + } + if(state.error) { self.state = null; } else {