Skip to content

Commit

Permalink
fix: check selector length (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed Feb 27, 2023
1 parent 5d765b9 commit 188d198
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/SchemaUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ function parseSelectors(step: object): Selector[] {
if (!isArray(step.selectors)) {
throw new Error('Step selectors are not an array');
}
if (step.selectors.length === 0) {
throw new Error('Step does not have required selectors');
}
return step.selectors.map((s) => {
if (!isString(s) && !isArray(s)) {
throw new Error('Selector is not an array or string');
Expand Down

0 comments on commit 188d198

Please sign in to comment.