fix: tolerate null labels/assignees/user in get_issue (#13) #23
Reference in New Issue
Block a user
Delete Branch "fix/get-issue-none-iterable"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #13.
Gitea can return JSON
nullfor an issue'slabels,assignees, oruserfields.dict.get(key, [])returnsNonewhen the key is present with a null value (the default is only used for missing keys), so the list comprehensions inget_issue_toolraised'NoneType' object is not iterablefor otherwise-valid issues.Change
or []/or {}so null/empty collections normalize to empty results.Gitea may return JSON null for an issue's `labels`, `assignees`, or `user` fields. `dict.get(key, [])` returns None when the key is present with a null value (the default is only used for missing keys), so the list comprehensions raised `'NoneType' object is not iterable` for otherwise-valid issues. Coalesce with `or []` / `or {}` so empty/null collections normalize to empty results. Adds a regression test covering all three null fields.