From a20ab024747a0764e78e1ce60f5bf8e6027343a2 Mon Sep 17 00:00:00 2001 From: Kevin Pfeifer Date: Wed, 19 Apr 2023 11:41:26 +0200 Subject: [PATCH] fix Undefined Array key Family in DefaultOs Signed-off-by: Kevin Pfeifer --- lib/OperatingSystems/DefaultOs.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/OperatingSystems/DefaultOs.php b/lib/OperatingSystems/DefaultOs.php index c81f4c3e..b25093fd 100644 --- a/lib/OperatingSystems/DefaultOs.php +++ b/lib/OperatingSystems/DefaultOs.php @@ -153,11 +153,13 @@ public function getNetworkInterfaces(): array { $data[] = $netInterface; foreach ($interface['unicast'] as $unicast) { - if ($unicast['family'] === self::AF_INET) { - $netInterface->addIPv4($unicast['address']); - } - if ($unicast['family'] === self::AF_INET6) { - $netInterface->addIPv6($unicast['address']); + if (isset($unicast['family'])) { + if ($unicast['family'] === self::AF_INET) { + $netInterface->addIPv4($unicast['address']); + } + if ($unicast['family'] === self::AF_INET6) { + $netInterface->addIPv6($unicast['address']); + } } }