mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-07 15:07:11 -04:00
Introduced more defensive checking for the end of a recipe.
This commit is contained in:
parent
7f0ce0da8d
commit
824c3935d9
1 changed files with 2 additions and 3 deletions
|
@ -159,8 +159,7 @@ Recipe.prototype.execute = function(dish, currentStep, state) {
|
|||
return e;
|
||||
};
|
||||
|
||||
// Operations can be asynchronous so we have to return a Promise to a
|
||||
// future value.
|
||||
// Operations can be asynchronous so we have to return a Promise to a future value.
|
||||
return new Promise(function(resolve, reject) {
|
||||
// Helper function to clean up recursing to the next recipe step.
|
||||
// It is a closure to avoid having to pass in resolve and reject.
|
||||
|
@ -180,7 +179,7 @@ Recipe.prototype.execute = function(dish, currentStep, state) {
|
|||
|
||||
currentStep = currentStep || 0;
|
||||
|
||||
if (currentStep === recipe.opList.length) {
|
||||
if (currentStep >= recipe.opList.length) {
|
||||
resolve(currentStep);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue