]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix error in pool list component
authorTiago Melo <tmelo@suse.com>
Wed, 4 Sep 2019 13:33:23 +0000 (13:33 +0000)
committerTiago Melo <tmelo@suse.com>
Wed, 11 Sep 2019 11:12:44 +0000 (11:12 +0000)
Sometimes the pools list result comes without the tiers field.
This was causing an error in the code.

Signed-off-by: Tiago Melo <tmelo@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts

index 11441b7d4af04a2a53fe1ed3bc62567fd5313a7c..847cf03751980c1906851cfc0aaaf511cad39279 100644 (file)
@@ -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));
   }