fix nodeselector when no element in the tree is selected

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>
This commit is contained in:
Dominik Csapak 2017-08-18 09:04:53 +02:00 committed by Fabian Grünbichler
parent 92dcef738a
commit a150a3d32e

View 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;
}