Skip to content

Commit

Permalink
fix: empty null rejection on early hero terminate
Browse files Browse the repository at this point in the history
  • Loading branch information
blakebyrnes committed May 30, 2022
1 parent 65ed29d commit 6159a79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/lib/CoreCommandQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default class CoreCommandQueue {
this.flushOnTimeout = null;

if (this.connection.disconnectPromise) {
return Promise.resolve(null);
throw new DisconnectedError(this.connection.transport.host);
}
for (const arg of args) {
if (Array.isArray(arg)) {
Expand Down
1 change: 1 addition & 0 deletions client/lib/Hero.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ export default class Hero extends AwaitedEventTarget<{

return this.#coreSessionPromise.then(coreSession => {
if (coreSession instanceof CoreSession) return coreSession;
if (coreSession === null) return null;
throw coreSession;
});
}
Expand Down

0 comments on commit 6159a79

Please sign in to comment.