From 144b6b221181eea8d81182f8bba72377c0280dab Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 28 May 2023 10:29:52 +0200 Subject: [PATCH] Bugfix/handle undefined in decode data source (#2013) * Handle undefined data source * Update changelog --- CHANGELOG.md | 4 ++++ libs/common/src/lib/helper.ts | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0b160b19..65331f538 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added a link to manage the benchmarks to the benchmark comparator - Added support for localized routes +### Fixed + +- Fixed an issue in the data source transformation + ## 1.272.0 - 2023-05-26 ### Added diff --git a/libs/common/src/lib/helper.ts b/libs/common/src/lib/helper.ts index d6da4ed94..bc02acbe6 100644 --- a/libs/common/src/lib/helper.ts +++ b/libs/common/src/lib/helper.ts @@ -15,7 +15,11 @@ export function capitalize(aString: string) { } export function decodeDataSource(encodedDataSource: string) { - return Buffer.from(encodedDataSource, 'hex').toString(); + if (encodedDataSource) { + return Buffer.from(encodedDataSource, 'hex').toString(); + } + + return undefined; } export function downloadAsFile({