Skip to content

Commit 4ee7862

Browse files
fix(azure-functions): only use return in InvocationContext.options if set (#4509)
https://github.com/Azure/azure-functions-nodejs-library/blob/138c0215136da5b19b879554da3468028426911e/types/InvocationContext.d.ts#L320 shows that the `InvocationContext.options.return` is optional. Closes: #4508 Co-authored-by: Trent Mick <[email protected]>
1 parent 6210c63 commit 4ee7862

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/instrumentation/azure-functions.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,9 @@ function instrument(agent) {
376376
direction: context?.options?.trigger?.direction,
377377
});
378378
// Output bindings
379-
bindingDefinitions.push(context?.options?.return);
379+
if (context?.options?.return) {
380+
bindingDefinitions.push(context?.options?.return);
381+
}
380382
}
381383
let executionContext = context.executionContext;
382384
if (!executionContext) {

0 commit comments

Comments
 (0)