From f36d7eb76c57b87bc3e574c0b1ab5a5c59f6a706 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Fri, 5 Apr 2024 23:14:11 +0300 Subject: [PATCH] Fix monitor thinking that OSD weight is 0 after deleting /osd/config/ key --- mon/mon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mon/mon.js b/mon/mon.js index a6f9d547..558e4375 100644 --- a/mon/mon.js +++ b/mon/mon.js @@ -886,7 +886,7 @@ class Mon { // Numeric IDs are reserved for OSDs const osd_cfg = this.state.config.osd[osd_num]; - let reweight = osd_cfg && Number(osd_cfg.reweight); + let reweight = osd_cfg == null ? 1 : Number(osd_cfg.reweight); if (reweight < 0 || isNaN(reweight)) reweight = 1; if (this.state.osd.state[osd_num] && reweight > 0)