Skip to content

Commit d03441e

Browse files
ashish07-07Ashish BKzrosenbauer
authored
fix(netlify): safely access optional logger (#1379)
Co-authored-by: Ashish BK <ashishbk@Ashishs-MacBook-Air.local> Co-authored-by: Zac Rosenbauer <me@zrosenbauer.com>
1 parent e898dd8 commit d03441e

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)