From 34e6fc3668280194a966219d665971c5ce5c50ff Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 28 May 2019 14:10:59 +0100 Subject: [PATCH] User info: make it possible to deserialize contentless user info. --- src/api/EteSync.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/EteSync.ts b/src/api/EteSync.ts index 182ec65..47d31cf 100644 --- a/src/api/EteSync.ts +++ b/src/api/EteSync.ts @@ -86,7 +86,9 @@ class BaseItem { public deserialize(json: T) { this._json = Object.assign({}, json); - this._encrypted = sjcl.codec.bytes.fromBits(sjcl.codec.base64.toBits(json.content)); + if (json.content) { + this._encrypted = sjcl.codec.bytes.fromBits(sjcl.codec.base64.toBits(json.content)); + } this._content = undefined; }