From 23a0d1035f9333c4e4a97999efc568abc9ba7fe9 Mon Sep 17 00:00:00 2001 From: Marcus Bakker Date: Thu, 15 Oct 2020 19:56:29 +0200 Subject: [PATCH] remove empty ('') detection location entries --- editor/src/pages/TechniquesPage.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/editor/src/pages/TechniquesPage.vue b/editor/src/pages/TechniquesPage.vue index 55348de..1ea7393 100644 --- a/editor/src/pages/TechniquesPage.vue +++ b/editor/src/pages/TechniquesPage.vue @@ -205,7 +205,13 @@ export default { yaml_input.techniques[i].detection[x].applicable_to = ['all']; } if (yaml_input.techniques[i].detection[x].location == undefined) { - yaml_input.techniques[i].detection[x].location = ['']; + yaml_input.techniques[i].detection[x].location = []; + } + let length_location = yaml_input.techniques[i].detection[x].location.length; + while (length_location--) { + if (yaml_input.techniques[i].detection[x].location[length_location] == '') { + yaml_input.techniques[i].detection[x].location.splice(length_location, 1); + } } if (yaml_input.techniques[i].detection[x].comment == undefined) { yaml_input.techniques[i].detection[x].comment = '';