Skip to content

Conversation

@mrhallak
Copy link

@mrhallak mrhallak commented Nov 13, 2025

Fix AttributeError when branches_to_generate is None

Problem

The generate_tasks command was failing with AttributeError: 'NoneType' object has no attribute 'items' when the module config file had branches_to_generate: null or the key was missing.

Screenshot 2025-11-13 at 12 40 28

Root Cause

In Module.__init__, self._branches_to_generate was assigned directly using config["branches_to_generate"], which could be None. Later, generate_task_configs() attempted to call .items() on this None value.

Solution

Changed the assignment to use config.get("branches_to_generate") or {} to ensure _branches_to_generate always defaults to an empty dictionary when the value is None or missing.

Before:
self._branches_to_generate = config["branches_to_generate"]After:
self._branches_to_generate = config.get("branches_to_generate") or {}## Additional Changes

  • Code formatting improvements for better readability (line breaks, consistent quote style)

Testing

This fix is backward compatible and allows the module system to gracefully handle configs without defined branches.

@mrhallak mrhallak requested a review from a team as a code owner November 13, 2025 11:32
@mrhallak mrhallak closed this Nov 14, 2025
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.

3 participants