From e34a0c37e59574f1036558886b00542f55b2cf62 Mon Sep 17 00:00:00 2001 From: Andrea Bogazzi Date: Sat, 22 Sep 2018 20:19:41 +0200 Subject: [PATCH] Do not access group property from the object (#5257) use the group reference --- src/shapes/group.class.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shapes/group.class.js b/src/shapes/group.class.js index b3eac7963b1..95b53f54834 100644 --- a/src/shapes/group.class.js +++ b/src/shapes/group.class.js @@ -230,9 +230,10 @@ * @return {Object} object representation of an instance */ toObject: function(propertiesToInclude) { + var _includeDefaultValues = this.includeDefaultValues; var objsToObject = this._objects.map(function(obj) { var originalDefaults = obj.includeDefaultValues; - obj.includeDefaultValues = obj.group.includeDefaultValues; + obj.includeDefaultValues = _includeDefaultValues; var _obj = obj.toObject(propertiesToInclude); obj.includeDefaultValues = originalDefaults; return _obj; @@ -253,9 +254,10 @@ objsToObject = sourcePath; } else { + var _includeDefaultValues = this.includeDefaultValues; objsToObject = this._objects.map(function(obj) { var originalDefaults = obj.includeDefaultValues; - obj.includeDefaultValues = obj.group.includeDefaultValues; + obj.includeDefaultValues = _includeDefaultValues; var _obj = obj.toDatalessObject(propertiesToInclude); obj.includeDefaultValues = originalDefaults; return _obj;