Skip to content

Commit

Permalink
Check for valid action names when importing sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
Ermad committed Feb 5, 2018
1 parent 40e6542 commit 379807c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,13 @@
var newSequence = JSON.parse(synthString);

if (Array.isArray(newSequence) && newSequence.length > 0) {
for (var i=0; i < newSequence.length; i++) {
var seqAction = newSequence[i];
if (!$scope.allActions[seqAction]) {
newSequence.splice(i, 1);
i--;
}
}
$scope.sequence = newSequence;
}
}
Expand Down

0 comments on commit 379807c

Please sign in to comment.