From 53fb36ff9a800c81f0a5eda19fb85190dc9d8891 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 27 Aug 2024 18:50:58 +0700 Subject: [PATCH] fix connection crash bug --- lib/OnyxConnectionManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OnyxConnectionManager.ts b/lib/OnyxConnectionManager.ts index f2564c58..cee40880 100644 --- a/lib/OnyxConnectionManager.ts +++ b/lib/OnyxConnectionManager.ts @@ -227,7 +227,7 @@ class OnyxConnectionManager { * Adds the connection to the eviction block list. Connections added to this list can never be evicted. * */ addToEvictionBlockList(connection: Connection): void { - const connectionMetadata = this.connectionsMap.get(connection.id); + const connectionMetadata = this.connectionsMap.get(connection?.id); if (!connectionMetadata) { return; } @@ -245,7 +245,7 @@ class OnyxConnectionManager { * which will enable it to be evicted again. */ removeFromEvictionBlockList(connection: Connection): void { - const connectionMetadata = this.connectionsMap.get(connection.id); + const connectionMetadata = this.connectionsMap.get(connection?.id); if (!connectionMetadata) { return; }