From 6c36da6ba52f6886d0de2b502b3aaff7f122c3a7 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Tue, 2 Jul 2024 15:49:30 +0200 Subject: [PATCH] fix: default single user state saving undefined value to state --- .../state/implementations/default-single-user-state.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/common/src/platform/state/implementations/default-single-user-state.ts b/libs/common/src/platform/state/implementations/default-single-user-state.ts index fc25e0afbc..b03351bc04 100644 --- a/libs/common/src/platform/state/implementations/default-single-user-state.ts +++ b/libs/common/src/platform/state/implementations/default-single-user-state.ts @@ -28,7 +28,9 @@ export class DefaultSingleUserState } protected override async doStorageSave(newState: T, oldState: T): Promise { - await super.doStorageSave(newState, oldState); + if (newState != null) { + await super.doStorageSave(newState, oldState); + } if (newState != null && oldState == null) { await this.stateEventRegistrarService.registerEvents(this.keyDefinition); }