Skip to content

Commit

Permalink
ensure view is not null when attempting to call __manager__ on it
Browse files Browse the repository at this point in the history
  • Loading branch information
tbranyen committed Oct 30, 2012
1 parent 15dc3cc commit 48cde02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions backbone.layoutmanager.js
Expand Up @@ -482,10 +482,10 @@ var LayoutManager = Backbone.View.extend({
// If this is an array of items remove items that are not marked to
// keep.
if (_.isArray(parentViews)) {
// Remove directly from the Array reference.
return _.each(parentViews, function(view, i) {
// Remove duplicate Views.
return _.each(_.clone(parentViews), function(view, i) {
// If the managers match, splice off this View.
if (view.__manager__ === manager) {
if (view && view.__manager__ === manager) {
aSplice.call(parentViews, i, 1);
}
});
Expand Down
2 changes: 1 addition & 1 deletion dist/backbone.layoutmanager.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 48cde02

Please sign in to comment.