[pve-devel] [PATCH widget-toolkit 2/2] apt repositories: avoid potential type error in classifyOrigin helper

Fiona Ebner f.ebner at proxmox.com
Fri Jun 9 16:16:26 CEST 2023


with undefined (or otherwise falsy) argument.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 src/node/APTRepositories.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/node/APTRepositories.js b/src/node/APTRepositories.js
index 47c0a2c..016118e 100644
--- a/src/node/APTRepositories.js
+++ b/src/node/APTRepositories.js
@@ -406,6 +406,7 @@ Ext.define('Proxmox.node.APTRepositories', {
     product: 'Proxmox VE', // default
 
     classifyOrigin: function(origin) {
+	origin ||= '';
 	if (origin.match(/^\s*Proxmox\s*$/i)) {
 	    return 'Proxmox';
 	} else if (origin.match(/^\s*Debian\s*(:?Backports)?$/i)) {
-- 
2.39.2






More information about the pve-devel mailing list