From 725c88f4bb571f734331526553f3818d9a4597d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sza=C5=82owski?= Date: Tue, 21 Jan 2025 14:49:01 +0100 Subject: [PATCH] fix: usage of trim on missing label --- CHANGELOG.md | 2 +- govtool/frontend/src/utils/testIdFromLabel.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77c637f71..c44c30fd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ changes. ### Fixed -- Fix calculating stake key balance [Issue 2653](https://github.com/IntersectMBO/govtool/issues/2653) +- Fix usage of trim on missing label ### Changed diff --git a/govtool/frontend/src/utils/testIdFromLabel.ts b/govtool/frontend/src/utils/testIdFromLabel.ts index 5c8c9cf4a..15beb443d 100644 --- a/govtool/frontend/src/utils/testIdFromLabel.ts +++ b/govtool/frontend/src/utils/testIdFromLabel.ts @@ -1,2 +1,2 @@ export const testIdFromLabel = (label: string) => - label.trim().replace(/ /g, "-").toLocaleLowerCase(); + label?.trim().replace(/ /g, "-").toLocaleLowerCase();