From c65f98b0bad74df7b96611be6541c68e8d5ee3e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KB=20J=C3=B8rgensen?= Date: Mon, 14 Nov 2016 10:08:06 +0100 Subject: [PATCH] Split code for added clarity. --- editor/svgcanvas.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 718aaea2..0d16031d 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -223,9 +223,11 @@ var addSvgElementFromJson = this.addSvgElementFromJson = function(data) { svgedit.utilities.cleanupElement(shape); // Children - if(data.children) data.children.forEach(function(child){ - shape.appendChild(addSvgElementFromJson(child)); - }); + if(data.children) { + data.children.forEach(function(child) { + shape.appendChild(addSvgElementFromJson(child)); + }); + } return shape; };