[pve-devel] [PATCH widget-toolkit] pending object grid: don't fall back to empty string for 0 values

Dominik Csapak d.csapak at proxmox.com
Mon Nov 17 12:21:00 CET 2025


if we have a value that is set to `0` (the number, not the string),
the default pending object grid renderer would overwrite that with the
empty string, since `0` does not evaluate to true.

Instead, use the `Nullish coalescing operator` (??) to overwrite the
value with only when it's null or undefined.

This fixes an issue with the rendering if the `TTY Count` in PVE is set
to 0. (There are no other options where this could happen currently,
because they either have a custom renderer, or do not allow 0 as value).

Reported-by: Dietmar Maurer <dietmar at proxmox.com>
Suggested-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
this replaces the first half of this patch:
https://lore.proxmox.com/pve-devel/20251117092110.628324-1-d.csapak@proxmox.com/

 src/grid/PendingObjectGrid.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/grid/PendingObjectGrid.js b/src/grid/PendingObjectGrid.js
index 6898717..c138713 100644
--- a/src/grid/PendingObjectGrid.js
+++ b/src/grid/PendingObjectGrid.js
@@ -74,7 +74,7 @@ Ext.define('Proxmox.grid.PendingObjectGrid', {
                 pending = undefined;
             }
         } else {
-            current = value || '';
+            current = value ?? '';
             pending = record.data.pending;
         }
 
-- 
2.47.3





More information about the pve-devel mailing list