From 6e893bccbbee0595b8825eab8c092990c16150fd Mon Sep 17 00:00:00 2001 From: Ovidijus Parsiunas Date: Thu, 18 Jul 2024 15:56:11 +0100 Subject: [PATCH] fixing nextjs app router typescript build warning --- .../nextjs/app-router/app/api/huggingface/image/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example-servers/nextjs/app-router/app/api/huggingface/image/route.ts b/example-servers/nextjs/app-router/app/api/huggingface/image/route.ts index 58525c51e..2988f214f 100644 --- a/example-servers/nextjs/app-router/app/api/huggingface/image/route.ts +++ b/example-servers/nextjs/app-router/app/api/huggingface/image/route.ts @@ -26,7 +26,7 @@ async function handler(req: NextRequest) { if (huggingFaceResult.error) throw huggingFaceResult.error; // Sends response back to Deep Chat using the Response format: // https://deepchat.dev/docs/connect/#Response - return NextResponse.json({text: huggingFaceResult[0].label}); + return NextResponse.json({text: huggingFaceResult[0]?.label || ''}); } export const POST = errorHandler(handler);