mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-23 07:36:12 +08:00
fix(nylas-api): When offline, response is undefined
This commit is contained in:
parent
d8ec1417ec
commit
d5a7a60700
1 changed files with 2 additions and 2 deletions
|
@ -122,9 +122,9 @@ class NylasAPI
|
|||
PriorityUICoordinator.settle.then =>
|
||||
Actions.didMakeAPIRequest({request: options, response: response})
|
||||
if error? or response.statusCode > 299
|
||||
if response.statusCode is 404 and options.returnsModel
|
||||
if response and response.statusCode is 404 and options.returnsModel
|
||||
@_handleModel404(options.url)
|
||||
if response.statusCode is 401
|
||||
if response and response.statusCode is 401
|
||||
@_handle401(options.url)
|
||||
options.error?(new APIError({error, response, body}))
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue