Fixed door logic per issue #506

This commit is contained in:
Nathan Byrd 2023-09-26 14:00:05 +00:00
parent fc107f1552
commit 1d31b268aa
1 changed files with 4 additions and 2 deletions

View File

@ -57,8 +57,10 @@ module.exports = class Door {
run(exeInfo, cb) {
this.encoding = (exeInfo.encoding || 'cp437').toLowerCase();
if ('socket' === this.io && !this.sockServer) {
return cb(Errors.UnexpectedState('Socket server is not running'));
if ('socket' === this.io) {
if(!this.sockServer) {
return cb(Errors.UnexpectedState('Socket server is not running'));
}
} else if ('stdio' !== this.io) {
return cb(Errors.Invalid(`"${this.io}" is not a valid io type!`));
}