From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id A757A1FF133 for ; Mon, 11 May 2026 11:05:14 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D8D0ADEA4; Mon, 11 May 2026 11:03:33 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v7 18/24] sdn: do not fail rendering record data if pending property is missing Date: Mon, 11 May 2026 11:01:54 +0200 Message-ID: <20260511090202.60323-19-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260511090202.60323-1-s.hanreich@proxmox.com> References: <20260511090202.60323-1-s.hanreich@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778490018905 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.627 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: ZPUODGZ5WDJB7B3TFXK4BTBRWBOAVLUN X-Message-ID-Hash: ZPUODGZ5WDJB7B3TFXK4BTBRWBOAVLUN X-MailFrom: s.hanreich@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The render helpers for the SDN pending status fail on rendering the values of the columns if the pending property does not exist. With the introduction of the prefix lists endpoint, where the API returns the id and the state of the prefix list only, but not the pending changes, the function fails silently and the error is swallowed by ExtJS. Handle this situation more gracefully by adding null checks when accessing the properties of the passed record. Signed-off-by: Stefan Hanreich --- www/manager6/Utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index be95d2167..220a033d3 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -193,13 +193,14 @@ Ext.define('PVE.Utils', { } else { return `${Ext.htmlEncode(value)}`; } - } else if (rec.data.pending[key] !== undefined && rec.data.pending[key] !== null) { + } else if (rec.data?.pending?.[key] !== undefined && rec.data?.pending?.[key] !== null) { if (rec.data.pending[key] === 'deleted') { return ' '; } else { return Ext.htmlEncode(rec.data.pending[key]); } } + return Ext.htmlEncode(value); }, @@ -216,7 +217,7 @@ Ext.define('PVE.Utils', { let tip = gettext('Pending Changes') + ':
'; - for (const [key, keyvalue] of Object.entries(rec.data.pending)) { + for (const [key, keyvalue] of Object.entries(rec.data.pending ?? {})) { if ( (rec.data[key] !== undefined && rec.data.pending[key] !== rec.data[key]) || rec.data[key] === undefined -- 2.47.3