From e7fbe3154896fa984330b5b17059569cf34cf57f Mon Sep 17 00:00:00 2001 From: Hendy Racher Date: Mon, 26 May 2014 21:45:11 +0100 Subject: [PATCH] fix to ensure empty json / xml collections return null --- .../Shared/SaveFormat/SaveFormatResource.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/nuComponents.DataTypes/Shared/SaveFormat/SaveFormatResource.js b/source/nuComponents.DataTypes/Shared/SaveFormat/SaveFormatResource.js index 5470e46..e797e59 100644 --- a/source/nuComponents.DataTypes/Shared/SaveFormat/SaveFormatResource.js +++ b/source/nuComponents.DataTypes/Shared/SaveFormat/SaveFormatResource.js @@ -9,6 +9,10 @@ angular.module('umbraco.resources') // returns a string representation of the picked options as per the configured SaveFormat createSaveValue: function (config, pickedOptions) { + if (pickedOptions == null || pickedOptions.length == 0) { + return null; + } + switch (config.saveFormat) { case 'csv': // "key, key..."