Make sure instance is running before applying new state

This commit is contained in:
Björn Dahlgren 2015-10-31 14:35:50 +01:00
parent 0bc37645b3
commit 2509417c08

View File

@ -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 {