From b0d2094bb3123e2abe4d24c3baf9e3fa2f7c2d80 Mon Sep 17 00:00:00 2001 From: Rens Tillmann Date: Fri, 17 Jan 2020 16:37:30 +0100 Subject: [PATCH] Update backbone.js Fix: JS TypeError. In case the _listeners object is undefined it will trigger an error. --- backbone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backbone.js b/backbone.js index 4ed524e89..74d5d5c98 100644 --- a/backbone.js +++ b/backbone.js @@ -374,7 +374,7 @@ // Cleans up memory bindings between the listener and the listenee. Listening.prototype.cleanup = function() { delete this.listener._listeningTo[this.obj._listenId]; - if (!this.interop) delete this.obj._listeners[this.id]; + if (!this.interop && typeof this.obj._listeners !== 'undefined' ) delete this.obj._listeners[this.id]; }; // Aliases for backwards compatibility.