Fix debug event call after resolve (#30)

This commit is contained in:
Victor Korkoshko 2019-11-16 00:49:52 +02:00 committed by Pierce
parent 4758defde4
commit 73bf1fe232

View file

@ -21,16 +21,17 @@ class Handler {
checkJava(java) {
return new Promise(resolve => {
child.exec(`${java} -version`, (error, stdout, stderr) => {
if(error) {
if (error) {
resolve({
run: false,
message: error
})
}
} else {
this.client.emit('debug', `[MCLC]: Using Java version ${stderr.match(/"(.*?)"/).pop()} ${stderr.includes('64-Bit') ? '64-bit': '32-Bit'}`);
resolve({
run: true
});
}
});
});
}