fix: show error when too many ingredient values are provided
This commit is contained in:
parent
b435acc6b4
commit
a5ebce7f2e
@ -242,6 +242,10 @@ class Operation {
|
|||||||
* @param {Object[]} ingValues
|
* @param {Object[]} ingValues
|
||||||
*/
|
*/
|
||||||
set ingValues(ingValues) {
|
set ingValues(ingValues) {
|
||||||
|
if (ingValues.length > this._ingList.length) {
|
||||||
|
throw new OperationError(`Failed to set ingredient values: more values provided than available ingredients (${ingValues.length} vs ${this._ingList.length})`);
|
||||||
|
}
|
||||||
|
|
||||||
ingValues.forEach((val, i) => {
|
ingValues.forEach((val, i) => {
|
||||||
try {
|
try {
|
||||||
this._ingList[i].value = val;
|
this._ingList[i].value = val;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user