From 7e032cd39bec41b0300403145da859221b2c9131 Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Fri, 9 Oct 2020 15:11:08 +0200
Subject: [PATCH] FEAT #13271 TIME 0:10 fix empty select

---
 src/frontend/plugins/select-search/select-search.component.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/frontend/plugins/select-search/select-search.component.ts b/src/frontend/plugins/select-search/select-search.component.ts
index 94d692ed6c0..0f465b3710b 100755
--- a/src/frontend/plugins/select-search/select-search.component.ts
+++ b/src/frontend/plugins/select-search/select-search.component.ts
@@ -394,7 +394,7 @@ export class PluginSelectSearchComponent implements OnInit, OnDestroy, AfterView
             if (ev.source._selected) {
                 this.selected = this.formControlSelect.value;
             } else {
-                this.selected = this.selected.filter((val: any) => val.id !== ev.source.value.id);
+                this.selected = this.selected.length > 0 ? this.selected.filter((val: any) => val.id !== ev.source.value.id) : [];
             }
         }
     }
-- 
GitLab