Bugfix: sieve undefined args[i-1]

This commit is contained in:
the-djmaze 2022-05-17 14:48:38 +02:00
parent e6ea47e75f
commit 882c0bde42
8 changed files with 17 additions and 17 deletions

View file

@ -69,13 +69,13 @@ export class DeleteHeaderCommand extends ActionCommand
args.forEach((arg, i) => {
if (':last' === arg) {
this.last = true;
} else if (':index' === args[i-1]) {
} else if (i && ':index' === args[i-1]) {
this.index.value = arg.value;
args[i] = null;
}
});
if (args[l-1] instanceof GrammarString) {
if (l && args[l-1] instanceof GrammarString) {
this.field_name = args[l-1];
this.value_patterns = args[l];
} else {