Skip to content

Commit aec3c50

Browse files
authored
Merge pull request #443 from cyrilst/patch-1
With FreeBSD jails, networkinfo->gateway can be empty
2 parents 1146b21 + 229b1fa commit aec3c50

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/OperatingSystems/FreeBSD.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ public function getNetworkInfo(): array {
126126
preg_match_all("/(?<=^default)\s*[0-9a-fA-f\.:]+/m", $netstat, $gw);
127127
if (count($gw[0]) > 0) {
128128
$result['gateway'] = implode(", ", array_map("trim", $gw[0]));
129+
} else {
130+
$result['gateway'] = '';
129131
}
130132
} catch (RuntimeException $e) {
131133
return $result;

0 commit comments

Comments
 (0)