From 28ef855892e5c9e49cb1e09ceea5c1899a49a192 Mon Sep 17 00:00:00 2001
From: Bastien Dumont <bdumont@grandlyon.com>
Date: Fri, 21 Jun 2024 14:26:40 +0200
Subject: [PATCH] fix(data): aborts if no data

---
 src/index.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/index.js b/src/index.js
index 0ceee32..fd56e40 100644
--- a/src/index.js
+++ b/src/index.js
@@ -90,7 +90,7 @@ async function start(fields, cozyParameters) {
 
     const eglData = await getData(response, baseUrl, apiAuthKey)
 
-    if (!eglData) {
+    if (eglData.length === 0) {
       log('debug', 'No data found')
       transaction.setStatus(Tracing.SpanStatus.Ok)
       transaction.finish()
-- 
GitLab