Skip to content

Commit bc49b2e

Browse files
authored
Merge pull request #438 from nextcloud/backport/437/stable26
[stable26] fix Undefined Array key Family in DefaultOs
2 parents 559b7c2 + a20ab02 commit bc49b2e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/OperatingSystems/DefaultOs.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,13 @@ public function getNetworkInterfaces(): array {
153153
$data[] = $netInterface;
154154

155155
foreach ($interface['unicast'] as $unicast) {
156-
if ($unicast['family'] === self::AF_INET) {
157-
$netInterface->addIPv4($unicast['address']);
158-
}
159-
if ($unicast['family'] === self::AF_INET6) {
160-
$netInterface->addIPv6($unicast['address']);
156+
if (isset($unicast['family'])) {
157+
if ($unicast['family'] === self::AF_INET) {
158+
$netInterface->addIPv4($unicast['address']);
159+
}
160+
if ($unicast['family'] === self::AF_INET6) {
161+
$netInterface->addIPv6($unicast['address']);
162+
}
161163
}
162164
}
163165

0 commit comments

Comments
 (0)