Skip to content

Commit

Permalink
Merge pull request javve#48 from endorama/master
Browse files Browse the repository at this point in the history
Script breaks when no listContainer is found
  • Loading branch information
javve committed Mar 2, 2012
2 parents c5c0273 + 24fc6eb commit 66f8913
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ var List = function(id, options, values) {
'updated': []
};
this.listContainer = (typeof(id) == 'string') ? document.getElementById(id) : id;
// Check if the container exists. If not return instead of breaking the javascript
if (!this.listContainer)
return;

this.items = [];
this.visibleItems = []; // These are the items currently visible
this.matchingItems = []; // These are the items currently matching filters and search, regadlessof visible count
Expand Down

0 comments on commit 66f8913

Please sign in to comment.