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,10 +129,12 @@ class InterfaceField extends BaseField
$allInterfacesDevices = array(); // mapping device -> interface handle (lan/wan/optX)
$configObj = Config::getInstance()->object();
// Iterate over all interfaces configuration and collect data
foreach ($configObj->interfaces->children() as $key => $value) {
$allInterfaces[$key] = $value;
if (!empty($value->if)) {
$allInterfacesDevices[(string)$value->if] = $key;
if (isset($configObj->interfaces) && $configObj->interfaces->count() > 0) {
foreach ($configObj->interfaces->children() as $key => $value) {
$allInterfaces[$key] = $value;
if (!empty($value->if)) {
$allInterfacesDevices[(string)$value->if] = $key;
}
}
}
......
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