1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix crash with NamespaceSelectFilter (#5367)

This commit is contained in:
Sebastian Malton 2022-05-11 15:05:21 -04:00 committed by GitHub
parent f0b26be79a
commit 6d7609b364
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,14 @@ export class NamespaceSelectFilterModel {
this.dependencies.namespaceStore.selectAll(); this.dependencies.namespaceStore.selectAll();
}; };
onChange = ([{ value: namespace }]: SelectOption[]) => { onChange = ([selected]: SelectOption<string>[]) => {
if (!selected) {
// This happens when pressing "Backspace" with an empty search field. Do nothing
return;
}
const { value: namespace } = selected;
if (namespace) { if (namespace) {
if (this.isMultiSelection) { if (this.isMultiSelection) {
this.dependencies.namespaceStore.toggleSingle(namespace); this.dependencies.namespaceStore.toggleSingle(namespace);