Skip to content

Commit 052bdaa

Browse files
authored
Fix Node 24 warning for invoking fs.existsSync with invalid argument type (#5687)
1 parent 8d6b823 commit 052bdaa

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/dd-trace/src/guardrails/telemetry.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ if (!process.env.DD_INJECTION_ENABLED) {
1414
module.exports = function () {}
1515
}
1616

17-
if (!process.env.DD_TELEMETRY_FORWARDER_PATH) {
18-
module.exports = function () {}
19-
}
20-
21-
if (!fs.existsSync(process.env.DD_TELEMETRY_FORWARDER_PATH)) {
17+
var telemetryForwarderPath = process.env.DD_TELEMETRY_FORWARDER_PATH
18+
if (typeof telemetryForwarderPath !== 'string' || !fs.existsSync(telemetryForwarderPath)) {
2219
module.exports = function () {}
2320
}
2421

0 commit comments

Comments
 (0)