[pve-devel] [PATCH manager] check for array in disallowednodes filter

Dominik Csapak d.csapak at proxmox.com
Mon Nov 21 16:46:07 CET 2016


extjs throws an error if disallowednodes is not an array,
so we need to check this

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/form/NodeSelector.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/www/manager6/form/NodeSelector.js b/www/manager6/form/NodeSelector.js
index fcb9cb1..56f6e5d 100644
--- a/www/manager6/form/NodeSelector.js
+++ b/www/manager6/form/NodeSelector.js
@@ -104,7 +104,11 @@ Ext.define('PVE.form.NodeSelector', {
 	// filter out disallowed nodes
 	me.getStore().addFilter(new Ext.util.Filter({
 	    filterFn: function(item) {
-		return !Ext.Array.contains(me.disallowedNodes, item.data.node);
+		if (Ext.isArray(me.disallowedNodes)) {
+		    return !Ext.Array.contains(me.disallowedNodes, item.data.node);
+		} else {
+		    return true;
+		}
 	    }
 	}));
 
-- 
2.1.4





More information about the pve-devel mailing list