Repository navigation
fix(server): treat None client results as empty - #189
Open
anderslindho wants to merge 1 commit into
Open
anderslindho wants to merge 1 commit into
anderslindho wants to merge 1 commit into
Conversation
Committing an IOC could fail with `TypeError: 'NoneType' object is not iterable`. pyCFClient's `findByArgs` returns `None` instead of raising when ChannelFinder answers 404, and the adapter then tried to loop over that `None`. ChannelFinder no longer answers an empty search with a 404, so this only happens against an older service, or when a proxy in front of it returns the 404. `getAllProperties` has the same problem and is fixed the same way.
|
simon-ess
reviewed
Nov 17, 2026
| if self._size_limit > 0: | ||
| args = args + [("~size", self._size_limit)] | ||
| return [CFChannel.from_dict(ch) for ch in self._client.findByArgs(args)] | ||
| return [CFChannel.from_dict(ch) for ch in self._client.findByArgs(args) or []] |
Contributor
There was a problem hiding this comment.
Maybe a bit more of a refactor, but might it not be nicer if findByArgs (and the other case below) returned a list instead of list | None?
Contributor
Author
There was a problem hiding this comment.
Good point, I agree. But as that requires a change and a release in pyCFClient, maybe merge this first and then do what you suggest?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Committing an IOC could fail with
TypeError: 'NoneType' object is not iterable. pyCFClient'sfindByArgsreturnsNoneinstead of raising when ChannelFinder answers 404, and the adapter then tried to loop over thatNone.ChannelFinder no longer answers an empty search with a 404, so this only happens against an older service, or when a proxy in front of it returns the 404.
getAllPropertieshas the same problem and is fixed the same way.Verified with test before and after fix. Closes #73