Permalink
Browse files

ensure view is not null when attempting to call __manager__ on it

  • Loading branch information...
1 parent 15dc3cc commit 48cde028db4035f26021297eed2b08e0655f7810 @tbranyen committed Oct 29, 2012
Showing with 4 additions and 4 deletions.
  1. +3 −3 backbone.layoutmanager.js
  2. +1 −1 dist/backbone.layoutmanager.min.js
@@ -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);
}
});

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 48cde02

Please sign in to comment.