From e5f61b54762b985a79f619d3b2bb6bc15a9ecd0a Mon Sep 17 00:00:00 2001 From: Robert Coie Date: Thu, 7 Aug 2025 16:50:47 -0700 Subject: [PATCH] make empty line check in SSE response more explicit so that JSON.parse knows it isn't getting undefined --- clientSSE.go.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clientSSE.go.tmpl b/clientSSE.go.tmpl index 8c87cab..523b9f5 100644 --- a/clientSSE.go.tmpl +++ b/clientSSE.go.tmpl @@ -76,7 +76,7 @@ const sseResponse = async ( let lines = buffer.split("\n"); for (let i = 0; i < lines.length - 1; i++) { const line = lines[i]; - if (line?.length === 0) { + if (!line || line.length === 0) { continue; } let data: any;