Skip to content

Conversation

@agrobbin
Copy link
Contributor

@agrobbin agrobbin commented Apr 7, 2025

Description

There should be no reason for the API to respond with a 200 OK and an empty body, however, sometimes that has happened to us, resulting in this exception:

NoMethodError: undefined method `[]' for nil

This comes from:

  • nylas/handler/api_operations.rb in get_list at line 34
  • nylas/resources/messages.rb in list at line 31

Instead of raising a NoMethodError when trying to access response, parse_response now explicitly checks that it's returning something.

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@agrobbin
Copy link
Contributor Author

agrobbin commented Apr 9, 2025

@AaronDDM Rubocop seems to be failing, but I'm not entirely sure why. The files it mentions that are causing failures were not touched in this PR.

@AaronDDM
Copy link
Contributor

AaronDDM commented Apr 9, 2025

@AaronDDM Rubocop seems to be failing, but I'm not entirely sure why. The files it mentions that are causing failures were not touched in this PR.

Can you rebase with the base branch? I think I fixed this issue.

There should be no reason for the API to respond with a `200 OK` and an empty body, however, sometimes that has happened to us, resulting in this exception:

```
NoMethodError: undefined method `[]' for nil
```

This comes from:

* `nylas/handler/api_operations.rb` in `get_list` at line `34`
* `nylas/resources/messages.rb` in `list` at line `31`

Instead of raising a `NoMethodError` when trying to access `response`, `parse_response` now explicitly checks that it's returning *something*.
@agrobbin agrobbin force-pushed the handle-successful-response-missing-body branch from d9eb509 to 0eb658f Compare April 9, 2025 22:57
@agrobbin
Copy link
Contributor Author

agrobbin commented Apr 9, 2025

@AaronDDM done!

@AaronDDM AaronDDM merged commit 33fff32 into nylas:main Apr 9, 2025
5 of 6 checks passed
@agrobbin
Copy link
Contributor Author

agrobbin commented Apr 9, 2025

Thanks so much @AaronDDM! Looking forward to this getting included in the next release.

@AaronDDM
Copy link
Contributor

AaronDDM commented Apr 9, 2025

Thanks so much @AaronDDM! Looking forward to this getting included in the next release.

If all goes well, the next release will be next week. Thanks for your contributions!

@AaronDDM AaronDDM mentioned this pull request Apr 30, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants