Skip to content

Commit

Permalink
Fix error due to undefined options (#4029)
Browse files Browse the repository at this point in the history
When options are undefined, doing `options.timeout` throws error and crash the whole node process.
#3939

Co-authored-by: Atif Saddique <[email protected]>
  • Loading branch information
2 people authored and tlhunter committed Feb 14, 2024
1 parent d628ff6 commit a6fe3a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/datadog-plugin-http/src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class HttpClientPlugin extends ClientPlugin {
// conditions for no error:
// 1. not using a custom agent instance with custom timeout specified
// 2. no invocation of `req.setTimeout`
if (!args.options.agent?.options.timeout && !customRequestTimeout) return
if (!args.options.agent?.options?.timeout && !customRequestTimeout) return

span.setTag('error', 1)
}
Expand Down

0 comments on commit a6fe3a9

Please sign in to comment.