diff --git a/src/client.js b/src/client.js index 8dc6cc19e..b9b3203bd 100644 --- a/src/client.js +++ b/src/client.js @@ -2135,9 +2135,17 @@ MatrixClient.prototype.getAccountDataFromServer = async function(eventType) { $userId: this.credentials.userId, $type: eventType, }); - return this._http.authedRequest( - undefined, "GET", path, undefined, - ); + try { + const result = await this._http.authedRequest( + undefined, "GET", path, undefined, + ); + return result; + } catch (e) { + if (e.data && e.data.errcode === 'M_NOT_FOUND') { + return null; + } + throw e; + } }; /**