Skip to content

fix: Avoid division by zero in stats percentage#80

Merged
DylanDevelops merged 1 commit intomainfrom
ravel/divide-by-zero-bug
Feb 12, 2026
Merged

fix: Avoid division by zero in stats percentage#80
DylanDevelops merged 1 commit intomainfrom
ravel/divide-by-zero-bug

Conversation

@DylanDevelops
Copy link
Owner

Pull Request Checklist

  • I have read and followed the contribution guidelines.
  • My pull request targets the main branch of tmpo.
  • I have tested these changes locally on my machine.

Description

This pull request makes a small but important change to the calculation of project percentage statistics in the ShowPeriodStats function. The update ensures that division by zero is avoided when computing percentages.

  • Added a conditional check to set percentage to 0.0 if totalDuration is zero, preventing potential division by zero errors in stats.go.

@DylanDevelops DylanDevelops merged commit e80491c into main Feb 12, 2026
6 checks passed
@DylanDevelops DylanDevelops deleted the ravel/divide-by-zero-bug branch February 12, 2026 17:46
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.

1 participant