From 68612892d100522229f089532e2e1dd44269a6bb Mon Sep 17 00:00:00 2001 From: Andrea Bogazzi Date: Sun, 20 Nov 2016 19:11:37 +0100 Subject: [PATCH] null check on setActive (#3435) --- src/canvas.class.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/canvas.class.js b/src/canvas.class.js index 795df7a516a..f09fb8fbc68 100644 --- a/src/canvas.class.js +++ b/src/canvas.class.js @@ -1477,9 +1477,11 @@ deactivateAll: function () { var allObjects = this.getObjects(), i = 0, - len = allObjects.length; + len = allObjects.length, + obj; for ( ; i < len; i++) { - allObjects[i].set('active', false); + obj = allObjects[i]; + obj && obj.set('active', false); } this._discardActiveGroup(); this._discardActiveObject();