From 55412a33ec24b53d2fe164145e232e59e239ed13 Mon Sep 17 00:00:00 2001 From: FroggyFlox <30297881+FroggyFlox@users.noreply.github.com> Date: Sat, 23 Feb 2019 19:05:15 -0500 Subject: [PATCH] Skip empty label fields Add simple if statement to ignore fields with empty values for labels. Fixes #2018. --- .../storageadmin/static/storageadmin/js/views/rockons.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rockstor/storageadmin/static/storageadmin/js/views/rockons.js b/src/rockstor/storageadmin/static/storageadmin/js/views/rockons.js index 3f925fc8b..f9f5558d5 100644 --- a/src/rockstor/storageadmin/static/storageadmin/js/views/rockons.js +++ b/src/rockstor/storageadmin/static/storageadmin/js/views/rockons.js @@ -1241,7 +1241,9 @@ RockonAddLabel = RockstorWizardPage.extend({ return $.Deferred().reject(); } var field_data = $('input[name^=labels]').map(function(idx, elem) { - return $(elem).val(); + if ($(elem).val() != "") { + return $(elem).val(); + } }).get(); var new_labels = {}; field_data.forEach(function(prop) {