From 8d9d5455557df0766a7bbe7d2b44b2b0ee7c0689 Mon Sep 17 00:00:00 2001 From: Benjamin Dehli Date: Wed, 1 May 2024 19:46:29 +0200 Subject: [PATCH] Add null check --- src/functions/helpers.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/functions/helpers.js b/src/functions/helpers.js index f763202..82010dc 100644 --- a/src/functions/helpers.js +++ b/src/functions/helpers.js @@ -1,4 +1,5 @@ export function capitalizeFirstLetter(string) { + if (!string?.length) return ""; return string.charAt(0).toUpperCase() + string.slice(1); }