fix(client/ui): silently fail ingredient input if any is null
This commit is contained in:
parent
1c9ffb9d13
commit
7d7158b121
1 changed files with 4 additions and 0 deletions
|
|
@ -75,6 +75,10 @@ public class IngredientListCell extends OrderedEditableListCell<RecipeIngredient
|
|||
String name = nameInput.getText();
|
||||
if (unit == null || !unit.isFormal()) {
|
||||
String desc = amountInput.getText();
|
||||
if (desc.isEmpty() || name.isEmpty()) {
|
||||
// TODO printError() integration
|
||||
return; // The user is forced to kindly try again until something valid comes up.
|
||||
}
|
||||
Ingredient newIngredient = new Ingredient(name, 0., 0., 0.);
|
||||
commitEdit(new VagueIngredient(newIngredient, desc));
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue