Skip to content

Commit

Permalink
fix(typeahead): Fixed potential error if value of typeahead is undefi…
Browse files Browse the repository at this point in the history
…ned. Fixes #345
  • Loading branch information
Marc Sluiter committed Mar 30, 2016
1 parent 18456f4 commit aeb2bc1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/typeahead/typeahead.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ export class Typeahead implements OnInit {
}

private processMatches() {

this._matches = [];

if (!this.typeahead) {
return;
}

// If singleWords, break model here to not be doing extra work on each iteration
let normalizedQuery = (this.typeaheadLatinize ? TypeaheadUtils.latinize(this.cd.model) : this.cd.model).toString().toLowerCase();
normalizedQuery = this.typeaheadSingleWords ? TypeaheadUtils.tokenize(normalizedQuery, this.typeaheadWordDelimiters, this.typeaheadPhraseDelimiters) : normalizedQuery;
Expand Down

0 comments on commit aeb2bc1

Please sign in to comment.