Commit 31952088 authored by Franco Fichtner's avatar Franco Fichtner

interfaces: fix a crash report in LAGG edit page

parent ebd02c22
......@@ -109,9 +109,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
foreach ($pconfig['members'] as $member) {
if (!does_interface_exist($member)) {
$input_errors[] = gettext("Interface supplied as member is invalid");
if (isset($pconfig['members'])) {
foreach ($pconfig['members'] as $member) {
if (!does_interface_exist($member)) {
$input_errors[] = sprintf(gettext('Interface \'%s\' supplied as member does not exist'), $member);
}
}
}
......@@ -182,7 +184,7 @@ legacy_html_escape_form_data($pconfig);
<select name="members[]" multiple="multiple" class="selectpicker">
<?php
foreach (available_interfaces(isset($id) ? $id : null) as $ifn => $ifinfo):?>
<option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['members']) ? "selected=\"selected\"" : "";?>>
<option value="<?=$ifn;?>" <?=!empty($pconfig['members']) && in_array($ifn, $pconfig['members']) ? "selected=\"selected\"" : "";?>>
<?=$ifn;?> (<?=$ifinfo['mac']?>)
</option>
<?php
......
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