From f345f82851cc34261c0277e4d14c32d52142c7fd Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Fri, 28 Feb 2020 11:19:07 -0800 Subject: [PATCH] Use optional chaining --- packages/grpc-js/src/subchannel-pool.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/grpc-js/src/subchannel-pool.ts b/packages/grpc-js/src/subchannel-pool.ts index d7bccb22..9c512934 100644 --- a/packages/grpc-js/src/subchannel-pool.ts +++ b/packages/grpc-js/src/subchannel-pool.ts @@ -101,7 +101,8 @@ export class SubchannelPool { }, REF_CHECK_INTERVAL); // Unref because this timer should not keep the event loop running. - this.cleanupTimer.unref && this.cleanupTimer.unref(); + // Call unref only if it exists to address electron/electron#21162 + this.cleanupTimer.unref?.(); } }