Skip to content

Conversation

@calilkhalil
Copy link

Description

Fixes an issue where the habits plugin crashes when encountering commits without an author property, which can occur with:

  • Bot commits
  • System-generated events
  • Merge commits from certain workflows
  • Archived repositories

Changes

  • Added a filter to check if commit?.author exists before destructuring
  • Prevents TypeError: Cannot destructure property 'author' of 'undefined'

Testing

Tested with repositories containing fork commits and automated merge events.

Related Issue

Fixes the error: TypeError: Cannot destructure property 'author' of 'undefined' at file:///metrics/source/plugins/habits/index.mjs:51:21

@calilkhalil
Copy link
Author

Closing this PR as I discovered #1739 already addresses this exact issue.

I'll add my support and testing feedback on that PR instead.

@calilkhalil calilkhalil closed this Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant