User info: make it possible to deserialize contentless user info.

master
Tom Hacohen 5 years ago
parent 61a4347a64
commit 34e6fc3668

@ -86,7 +86,9 @@ class BaseItem<T extends BaseItemJson> {
public deserialize(json: T) { public deserialize(json: T) {
this._json = Object.assign({}, json); this._json = Object.assign({}, json);
if (json.content) {
this._encrypted = sjcl.codec.bytes.fromBits(sjcl.codec.base64.toBits(json.content)); this._encrypted = sjcl.codec.bytes.fromBits(sjcl.codec.base64.toBits(json.content));
}
this._content = undefined; this._content = undefined;
} }

Loading…
Cancel
Save