fix crash when reboot is pressed more than once

This commit is contained in:
elijahr2411 committed 2023-02-07 14:09:30 -05:00
1 parent b46ee1360b
commit 63b641ec58
1 file changed
+4 -1
+4 -1
View File
@@ -154,7 +154,10 @@ export default class QEMUVM extends EventEmitter {
}
Reboot() : Promise<void> {
return this.qmpClient.reboot();
return new Promise(async (res, rej) => {
if (this.expectedExit) {res(); return;}
res(await this.qmpClient.reboot());
});
}
async Restore() {