diff --git a/internal_packages/message-list/lib/message-item.cjsx b/internal_packages/message-list/lib/message-item.cjsx index 7df924ff5..16202489d 100644 --- a/internal_packages/message-list/lib/message-item.cjsx +++ b/internal_packages/message-list/lib/message-item.cjsx @@ -196,7 +196,7 @@ class MessageItem extends React.Component headers: Accept: 'message/rfc822' path: "/n/#{@props.message.namespaceId}/messages/#{@props.message.id}" - json:null + json:false success: (body) => fs.writeFile tmpfile, body, => window = new BrowserWindow(width: 800, height: 600, title: "#{@props.message.subject} - RFC822") diff --git a/src/flux/nylas-api.coffee b/src/flux/nylas-api.coffee index cae8ba8ac..8fd252cf5 100644 --- a/src/flux/nylas-api.coffee +++ b/src/flux/nylas-api.coffee @@ -126,15 +126,14 @@ class NylasAPI @_handleModel404(options.url) if response.statusCode is 401 @_handle401(options.url) - if options.error - options.error(new APIError({error, response, body})) + options.error?(new APIError({error, response, body})) else if options.json if _.isString(body) try body = JSON.parse(body) catch error - options.error(new APIError({error, response, body})) + options.error?(new APIError({error, response, body})) if options.returnsModel @_handleModelResponse(body)