]> git.proxmox.com Git - pve-manager.git/commitdiff
fix nodeselector when no element in the tree is selected
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 18 Aug 2017 07:04:53 +0000 (09:04 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 22 Aug 2017 08:27:03 +0000 (10:27 +0200)
it can happen that nothing in the tree is selected,
then PVE.curSelectedNode is undefined, generating an exception there.
so we check if this is available

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/form/NodeSelector.js

index 0cc60bf721a9d599d15aac9effaa87196675f691..6fcced3719748efade7964831f745b0185c8711d 100644 (file)
@@ -94,7 +94,7 @@ Ext.define('PVE.form.NodeSelector', {
     initComponent: function() {
        var me = this;
 
-        if (me.selectCurNode && PVE.curSelectedNode.data.node) {
+        if (me.selectCurNode && PVE.curSelectedNode && PVE.curSelectedNode.data.node) {
             me.preferredValue = PVE.curSelectedNode.data.node;
         }