Skip to content

Commit d26e97b

Browse files
Ashish BKAshish BK
authored andcommitted
fix(netlify): safely access optional logger
1 parent 0d8c7f9 commit d26e97b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • examples/with-netlify-functions/src/tools

examples/with-netlify-functions/src/tools/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const weatherTool = createTool({
99
location: z.string().describe("City or location to look up"),
1010
}),
1111
execute: async ({ location }, context) => {
12-
context?.logger.info(`Fetching weather for ${location}`);
12+
context?.logger?.info(`Fetching weather for ${location}`);
1313

1414
const mockWeatherData = {
1515
location,

0 commit comments

Comments
 (0)