From e24cd0de81b8fc5c43989a8fe413348637ee2437 Mon Sep 17 00:00:00 2001 From: daniel-lxs Date: Mon, 22 Dec 2025 18:08:45 -0500 Subject: [PATCH] fix: replace confusing logHandle! with proper undefined type --- src/api/providers/anthropic.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/providers/anthropic.ts b/src/api/providers/anthropic.ts index 5bfcf37757..f3c8a514d1 100644 --- a/src/api/providers/anthropic.ts +++ b/src/api/providers/anthropic.ts @@ -99,7 +99,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa : {} // Variable to hold the log handle - will be created after request body is built - let logHandle: ReturnType + let logHandle: ReturnType | undefined try { switch (modelId) { @@ -379,7 +379,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa }) } catch (error) { // logHandle may not be assigned if error occurs before request body is built - if (logHandle!) { + if (logHandle) { logHandle.error(error) } throw error