From 1c2beed94b739f1a990e0f725f9a33f5e42d7d3a Mon Sep 17 00:00:00 2001 From: Emil Widlund Date: Thu, 14 Sep 2023 23:01:39 +0200 Subject: [PATCH] Use optional chain in dispose of Connection --- packages/core/package.json | 2 +- packages/core/src/Connection/Connection.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 70e8dc8..7db0c3c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@nodl/core", - "version": "1.0.6", + "version": "1.0.7", "description": "Core implementation of the Nodl framework", "main": "build/index.js", "author": "Emil Widlund", diff --git a/packages/core/src/Connection/Connection.ts b/packages/core/src/Connection/Connection.ts index 0cf7c88..f250cc5 100644 --- a/packages/core/src/Connection/Connection.ts +++ b/packages/core/src/Connection/Connection.ts @@ -50,7 +50,7 @@ export class Connection extends Subject { /** Disposes the Connection */ public dispose() { this.unsubscribe(); - this.subscription.unsubscribe(); + this.subscription?.unsubscribe(); this.from.connections = this.from.connections.filter(connection => connection !== this); this.to.connection = null;