mirror of
https://github.com/ceph/ceph
synced 2025-02-19 08:57:27 +00:00
mgr/dashboard: Fix validation of OSDs
There were situations where the OSD was removed and then we tried to access some property of the OSD object, causing a frontend error. Signed-off-by: Tiago Melo <tmelo@suse.com>
This commit is contained in:
parent
e78569a4cb
commit
0a27d5a1aa
@ -241,13 +241,14 @@ export class OsdListComponent implements OnInit {
|
||||
return true;
|
||||
}
|
||||
|
||||
const validOsds = [];
|
||||
let validOsds = [];
|
||||
if (this.selection.hasSelection) {
|
||||
for (const osdId of this.getSelectedIds()) {
|
||||
validOsds.push(this.osds.filter((o) => o.id === osdId).pop());
|
||||
}
|
||||
}
|
||||
|
||||
validOsds = validOsds.filter((osd) => !_.isUndefined(osd));
|
||||
if (validOsds.length === 0) {
|
||||
// `osd` is undefined if the selected OSD has been removed.
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user