From a8b8845b7a2cac6a56a2a106da82ceb773bca287 Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Wed, 4 Sep 2019 13:33:23 +0000 Subject: [PATCH] mgr/dashboard: Fix error in pool list component Sometimes the pools list result comes without the tiers field. This was causing an error in the code. Signed-off-by: Tiago Melo --- .../src/app/ceph/pool/pool-list/pool-list.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts index 11441b7d4af04..847cf03751980 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts @@ -282,7 +282,9 @@ export class PoolListComponent implements OnInit { } getSelectionTiers() { - const cacheTierIds = this.selection.hasSingleSelection ? this.selection.first()['tiers'] : []; + const cacheTierIds = this.selection.hasSingleSelection + ? this.selection.first()['tiers'] || [] + : []; this.selectionCacheTiers = this.pools.filter((pool) => cacheTierIds.includes(pool.pool)); } -- 2.39.5