N3Roaster / typica

Free software for coffee roasting operations.
https://typica.us
MIT License
26 stars 8 forks source link

Batch log shows nothing when a batch has a green weight of 0 #137

Closed N3Roaster closed 9 years ago

N3Roaster commented 9 years ago

Roasting a batch of 0 green coffee makes no sense, but people accidentally enter that and then the weight loss calculation in this view fails on the division by 0, breaking the log. The weight loss calculation should have a guard to prevent the division by 0. Ideally the new batch window would prevent entering that in the first place, but Typica isn't the only way for data to get into the database so the view shouldn't break regardless.