Skip to content

Conversation

@nickbeen
Copy link
Owner

@nickbeen nickbeen commented Jan 24, 2025

What does this pull request do?

This PR fixes a possible "division by zero" error when explicitly setting zero as progress when the currently made progress is also zero.

Fixes #21

Why is this pull request needed?

This library should gracefully finish the progress bar instead of displaying a PHP-specific error.

How does this pull request work?

Progress is now explicitly set to at least one during the remaining time calculation. Furthermore a new boolean value is placed to track whether maxProgress was meant to be zero as maxProgress itself cannot be zero when displaying the progress bar.

@nickbeen nickbeen added the fixed For any bug fixes label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixed For any bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Division by zero

2 participants