Commit a0148151 authored by Franco Fichtner's avatar Franco Fichtner

mvc: try to fix crash report

(cherry picked from commit a14da189)
(cherry picked from commit 2b0cb7be)
parent bcc04a3c
...@@ -129,12 +129,14 @@ class InterfaceField extends BaseField ...@@ -129,12 +129,14 @@ class InterfaceField extends BaseField
$allInterfacesDevices = array(); // mapping device -> interface handle (lan/wan/optX) $allInterfacesDevices = array(); // mapping device -> interface handle (lan/wan/optX)
$configObj = Config::getInstance()->object(); $configObj = Config::getInstance()->object();
// Iterate over all interfaces configuration and collect data // Iterate over all interfaces configuration and collect data
if (isset($configObj->interfaces) && $configObj->interfaces->count() > 0) {
foreach ($configObj->interfaces->children() as $key => $value) { foreach ($configObj->interfaces->children() as $key => $value) {
$allInterfaces[$key] = $value; $allInterfaces[$key] = $value;
if (!empty($value->if)) { if (!empty($value->if)) {
$allInterfacesDevices[(string)$value->if] = $key; $allInterfacesDevices[(string)$value->if] = $key;
} }
} }
}
if ($this->internalAddParentDevices) { if ($this->internalAddParentDevices) {
// collect parents for lagg/vlan interfaces // collect parents for lagg/vlan interfaces
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment