diff --git a/legacy/src/app/controllers/node_details_networking.js b/legacy/src/app/controllers/node_details_networking.js index 41e4ad19070..fb9018cf1a1 100644 --- a/legacy/src/app/controllers/node_details_networking.js +++ b/legacy/src/app/controllers/node_details_networking.js @@ -342,9 +342,9 @@ export function NodeNetworkingController( } ]; - $scope.isBond = item => item.type === "bond"; - $scope.isBridge = item => item.type === "bridge"; - $scope.isInterface = item => item.type === "physical"; + $scope.isBond = item => item.type && item.type === "bond"; + $scope.isBridge = item => item.type && item.type === "bridge"; + $scope.isInterface = item => item.type && item.type === "physical"; // Sets loaded to true if both the node has been loaded at the // other required managers for this scope have been loaded. @@ -2029,18 +2029,16 @@ export function NodeNetworkingController( // Return true when a bridge can be created based on the current // selection. Only can be done if no aliases are selected and only // one interface is selected. - $scope.canCreateBridge = function() { - if ($scope.selectedMode !== SELECTION_MODE.SINGLE) { - return false; - } - var nic = getSelectedInterfaces()[0]; - if ( - nic.type === INTERFACE_TYPE.ALIAS || - nic.type === INTERFACE_TYPE.BRIDGE - ) { + $scope.canCreateBridge = () => { + const selectedInterfaces = getSelectedInterfaces(); + const nic = selectedInterfaces.length && selectedInterfaces[0]; + + if ($scope.selectedMode !== SELECTION_MODE.SINGLE || !nic) { return false; } - return true; + return !( + nic.type === INTERFACE_TYPE.ALIAS || nic.type === INTERFACE_TYPE.BRIDGE + ); }; // Return true when the create bridge view is being shown. diff --git a/legacy/src/app/partials/node-details.html b/legacy/src/app/partials/node-details.html index 0a3aa3c9e5b..a12af7eae5b 100755 --- a/legacy/src/app/partials/node-details.html +++ b/legacy/src/app/partials/node-details.html @@ -926,9 +926,9 @@

Create bridge

-
- {$ interface.fabric.name $} - Disconnected +
+ {$ interface.fabric && interface.fabric.name $} + Disconnected