From 5078c064f09743708cd075bb2d4c2ac82e67537f Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 21 Mar 2019 01:32:59 -0500 Subject: [PATCH] fix: safe destroy --- traits/informed.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/traits/informed.js b/traits/informed.js index fb304c4..6842209 100644 --- a/traits/informed.js +++ b/traits/informed.js @@ -22,8 +22,10 @@ class InformedBase extends Trait { } destroy() { - delete this._socket.entity; - delete this._socket; + if (this._socket) { + delete this._socket.entity; + delete this._socket; + } } reduceStateDiffForEntityList(diff, position) {