From 551c00b6b286602d710243ff45c228a7e3b75822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Thu, 20 Apr 2023 11:37:38 +0200 Subject: [PATCH] fix: compilation issues from event-store (#3568) ## About the changes Reduce compilation errors on event-store --- src/lib/db/event-store.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/db/event-store.ts b/src/lib/db/event-store.ts index 302079fb85..4bd2980006 100644 --- a/src/lib/db/event-store.ts +++ b/src/lib/db/event-store.ts @@ -109,6 +109,9 @@ class EventStore implements IEventStore { let count = await this.db(TABLE) .count>() .first(); + if (!count) { + return 0; + } if (typeof count.count === 'string') { return parseInt(count.count, 10); } else { @@ -128,6 +131,9 @@ class EventStore implements IEventStore { query = query.andWhere({ feature_name: eventSearch.feature }); } let count = await query.count().first(); + if (!count) { + return 0; + } if (typeof count.count === 'string') { return parseInt(count.count, 10); } else {