Skip to content

Conversation

@gitauto-for-dev
Copy link

Resolves #31

Why the bug occurs

The TypeError: 'NoneType' object is not iterable occurs in the filter_my_comments function within comment_manager.py at line 42. This happens because the function attempts to iterate over a None value, likely returned due to a failed API call or missing data.

How to reproduce

  1. Trigger the filter_my_comments function in comment_manager.py under conditions where the expected data is None.
  2. Observe the TypeError when the function tries to iterate over the None value.

Where / How to code and why

To fix the bug, update the filter_my_comments function in comment_manager.py to handle cases where the data is None. Implement a check to ensure that the data is iterable before attempting to iterate over it. Additionally, enhance the error handling for API calls to prevent None from being returned unexpectedly.

This ensures that the function handles unexpected None values gracefully, adhering to robust coding practices and preventing runtime errors.

Anything the issuer needs to do

No action required.

Test these changes locally

git fetch origin
git checkout gitauto-wes/issue-31-20250128-144141
git pull origin gitauto-wes/issue-31-20250128-144141

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.

TypeError 'NoneType' object is not iterable

2 participants