From 2d009aacc4f161be057fee5d52d32b1fc541c04a Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 10 Jun 2023 12:01:26 +0200 Subject: [PATCH] Bugfix/handle value nullifcation for undefined object (#2064) * Handle undefined object * Update changelog --- CHANGELOG.md | 4 ++++ apps/api/src/helper/object.helper.ts | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdd2cbea7..a1a6f29fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Improved the language localization for French (`fr`) +### Fixed + +- Fixed an issue with the value nullification related to the investment streaks + ## 1.278.0 - 2023-06-09 ### Changed diff --git a/apps/api/src/helper/object.helper.ts b/apps/api/src/helper/object.helper.ts index 6db53b0a1..50a4f2b12 100644 --- a/apps/api/src/helper/object.helper.ts +++ b/apps/api/src/helper/object.helper.ts @@ -16,9 +16,11 @@ export function hasNotDefinedValuesInObject(aObject: Object): boolean { export function nullifyValuesInObject(aObject: T, keys: string[]): T { const object = cloneDeep(aObject); - keys.forEach((key) => { - object[key] = null; - }); + if (object) { + keys.forEach((key) => { + object[key] = null; + }); + } return object; }