fix(gateway): guard interface discovery failures

Closes #44180.
Refs #47590.
Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
Peter Steinberger
2026-03-22 14:26:35 -07:00
parent 44bbd2d83d
commit 3faaf8984f
7 changed files with 56 additions and 3 deletions

View File

@@ -118,7 +118,12 @@ function pickIPv4Matching(
networkInterfaces: () => ReturnType<typeof os.networkInterfaces>,
matches: (address: string) => boolean,
): string | null {
const nets = networkInterfaces();
let nets: ReturnType<typeof os.networkInterfaces>;
try {
nets = networkInterfaces();
} catch {
return null;
}
for (const entries of Object.values(nets)) {
if (!entries) {
continue;