From a68c04b35545d1a7661a36904a1cb51943275c9e Mon Sep 17 00:00:00 2001 From: "SPRINX0\\prochazka" Date: Wed, 4 Sep 2024 16:32:09 +0200 Subject: [PATCH] fix --- packages/api/src/utility/hardwareFingerprint.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/api/src/utility/hardwareFingerprint.js b/packages/api/src/utility/hardwareFingerprint.js index a9b8d3e2..c944ffe3 100644 --- a/packages/api/src/utility/hardwareFingerprint.js +++ b/packages/api/src/utility/hardwareFingerprint.js @@ -12,15 +12,19 @@ async function getPublicIp() { } function getMacAddress() { - const interfaces = os.networkInterfaces(); - for (let iface of Object.values(interfaces)) { - for (let config of iface) { - if (config.mac && config.mac !== '00:00:00:00:00:00') { - return config.mac; + try { + const interfaces = os.networkInterfaces(); + for (let iface of Object.values(interfaces)) { + for (let config of iface) { + if (config.mac && config.mac !== '00:00:00:00:00:00') { + return config.mac; + } } } + return '00:00:00:00:00:00'; + } catch (err) { + return '00:00:00:00:00:00'; } - return '00:00:00:00:00:00'; } async function getHardwareFingerprint() {