From ddf176bb50498f9b37918701e3411d0071d70001 Mon Sep 17 00:00:00 2001 From: Daniel Kucal Date: Wed, 17 Jan 2018 07:59:12 +0100 Subject: [PATCH] fix(WebStorageService): fix update() method for not existing keys in cookies --- src/service/webstorage.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service/webstorage.service.ts b/src/service/webstorage.service.ts index 44e131c..ff36d32 100644 --- a/src/service/webstorage.service.ts +++ b/src/service/webstorage.service.ts @@ -41,7 +41,7 @@ export abstract class WebStorageService { public update(key: string, changes: any): any { const value = this.get(key); - if (typeof value !== 'object') { + if (value !== undefined && typeof value !== 'object') { debug.throw(new Error(`Value stored under "${key}" key is not an object and tried to be updated.`)); return value; }