From 50c83516a931b5e29396016ec070ee89eee88258 Mon Sep 17 00:00:00 2001 From: rjohanek Date: Mon, 28 Oct 2024 16:03:46 -0400 Subject: [PATCH] return empty string if no reader can be made from the readable stream --- src/components/SignInButton.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/SignInButton.tsx b/src/components/SignInButton.tsx index 15c6a7850..b22e55c9f 100644 --- a/src/components/SignInButton.tsx +++ b/src/components/SignInButton.tsx @@ -116,14 +116,13 @@ export const SignInButton = (props: SignInButtonProps) => { const streamToString = async (error: HttpError): Promise => { const reader = error.body?.getReader(); + let result = ''; + const decoder = new TextDecoder('utf-8'); if (!reader) { - return 'Error message not readable.'; + return result; } - const decoder = new TextDecoder('utf-8'); - let result = ''; - // eslint-disable-next-line no-constant-condition while (true) { const { done, value } = await reader.read();