Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix division by zero error in rack space calculation. (functions: getRSUforRack, getRSUforRow) #292

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MarcHagen
Copy link
Contributor

Previously, a division by zero occurred when the rack was empty and no rack space was available. This change adds a condition to return 0 when the total counter value is zero, preventing the error.

Previously, a division by zero occurred when the rack was empty and no rack space was available. This change adds a condition to return 0 when the total counter value is zero, preventing the error.
@infrastation
Copy link
Member

Thank you for preparing this bug fix. What are the steps to reproduce the problem?

@MarcHagen
Copy link
Contributor Author

MarcHagen commented Jan 28, 2025

  1. Create a new row (any props is fine)
  2. Create a new rack (any props is fine)
  3. On the newly created rack go to Design
  4. Unselect all the rows/columns in the Rack design
  5. Hit the Set rack design button
  6. Profit with 500 error on the rack page
  7. Profit with 500 error on the view row page (will only happen if the one or all racks have no design, if there is a second rack that has selected design options it will show the page correctly.)

@infrastation
Copy link
Member

Thank you, let me have a closer look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants