Fix fermentable percent check if there are no fermentables.

Mon, 02 May 2022 21:09:48 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 02 May 2022 21:09:48 +0200
changeset 188
ff09c95d9e44
parent 187
91af2c697345
child 189
722a4eed545d

Fix fermentable percent check if there are no fermentables.

src/EditProduct.cpp file | annotate | diff | comparison | revisions
--- a/src/EditProduct.cpp	Mon May 02 16:40:41 2022 +0200
+++ b/src/EditProduct.cpp	Mon May 02 21:09:48 2022 +0200
@@ -401,7 +401,7 @@
 		    product->fermentables.append(f);
 		}
 		qDebug() << "fermentables" << product->fermentables.size() << percentcheck;
-		if (percentcheck == 0) {
+		if (percentcheck == 0 && product->fermentables.size()) {
 		    /* Missing percentages, fix it. */
 		    double total = 0;
 		    for (int i = 0; i < product->fermentables.size(); i++) {

mercurial