Skip to content

Conversation

@nevans
Copy link
Collaborator

@nevans nevans commented Oct 4, 2023

By converting all of the internal @responses.delete(type) to clear_responses(type), we get empty arrays and don't need nil-checks.

n.b: this will result in some methods sometimes returning an empty array when they previously would have returned nil: list, xlist, getquota, lsub, expunge, uid_expunge, fetch, uid_fetch, store, and uid_store.

By converting all of the internal `@responses.delete(type)` to
`clear_responses(type)`, we get empty arrays and don't need nil-checks.

Fixes #190.
@nevans nevans merged commit 6acb125 into master Oct 4, 2023
@nevans nevans deleted the workaround-no-matching-responses branch October 4, 2023 02:56
nevans added a commit that referenced this pull request Oct 5, 2023
`#fetch` returns an empty array, rather than nil, since #192.
nevans added a commit that referenced this pull request Oct 6, 2023
`#fetch` returns an empty array, rather than nil, since #192.
philippks added a commit to hitobito/hitobito that referenced this pull request Aug 21, 2025
As described [here](ruby/net-imap#192), some
imap functions now return an empty array and not anymore `nil`. This is
also the case for the used function `uid_fetch`.

Now, we check correctly for `.blank?` instead of `.nil?`.

I didn't find other occurences where the changed API has an impact.
carlobeltrame pushed a commit to hitobito/hitobito that referenced this pull request Aug 22, 2025
As described [here](ruby/net-imap#192), some
imap functions now return an empty array and not anymore `nil`. This is
also the case for the used function `uid_fetch`.

Now, we check correctly for `.blank?` instead of `.nil?`.

I didn't find other occurences where the changed API has an impact.
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.

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

2 participants