mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-11 02:30:21 +08:00
[client-app] Fix error when attempting to report a fetch id error
Summary: When reporting error inside `IdentityStore._fetchIdentity`, we would pass null as the `extra` parameter for `reportError`. This would cause us to try to assign something to null and throw an error while reporting the error. (Even though `extra` has a default value of `{}` (see declaration of `NylasEnv.reportError`), passing null will be interpreted as a valid arg and it wont get assigned the default value) Thankfully, the second error /is/ reported to sentry: https://sentry.io/nylas/nylas-mail/issues/230589717/ Test Plan: manual Reviewers: mark, halla, spang, evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D4150
This commit is contained in:
parent
20a05d3340
commit
667e1d6691
1 changed files with 1 additions and 1 deletions
|
@ -184,7 +184,7 @@ class IdentityStore extends NylasStore {
|
||||||
const json = await this.fetchPath('/n1/user');
|
const json = await this.fetchPath('/n1/user');
|
||||||
if (!json || !json.id || json.id !== this._identity.id) {
|
if (!json || !json.id || json.id !== this._identity.id) {
|
||||||
console.error(json)
|
console.error(json)
|
||||||
NylasEnv.reportError(new Error("Remote Identity returned invalid json"), json)
|
NylasEnv.reportError(new Error("Remote Identity returned invalid json"), json || {})
|
||||||
return Promise.resolve(this._identity)
|
return Promise.resolve(this._identity)
|
||||||
}
|
}
|
||||||
const nextIdentity = Object.assign({}, this._identity, json);
|
const nextIdentity = Object.assign({}, this._identity, json);
|
||||||
|
|
Loading…
Reference in a new issue