Introduce even more optional chaining in the code-base

This replaces a few more small/simple if-statements with optional chaining.
This commit is contained in:
Jonas Jenwald 2023-08-09 17:03:25 +02:00
parent f89020e9b1
commit ec7746350d
3 changed files with 7 additions and 12 deletions

View file

@ -2533,11 +2533,9 @@ class WorkerTransport {
this.#methodPromises.clear();
this.filterFactory.destroy();
if (this._networkStream) {
this._networkStream.cancelAllRequests(
new AbortException("Worker was terminated.")
);
}
this._networkStream?.cancelAllRequests(
new AbortException("Worker was terminated.")
);
if (this.messageHandler) {
this.messageHandler.destroy();