Skip to content

Commit

Permalink
Check if patterns exists
Browse files Browse the repository at this point in the history
  • Loading branch information
kevva committed Mar 18, 2015
1 parent 96434d4 commit 2e525f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion permission/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ module.exports = yeoman.generators.Base.extend({
this.prompt(prompt, function (answers) {
var patterns = answers.matchPatterns;

function hasPattern(pattern) {return patterns.indexOf(pattern) !== -1;};
function hasPattern(pattern) {
return patterns && patterns.indexOf(pattern) !== -1;
}

// Push match-patterns wichi user has selected.
if (hasPattern('allURLs'))
Expand Down

0 comments on commit 2e525f4

Please sign in to comment.