diff --git a/src/data.js b/src/data.js index 6e1465b3b..e6915e9b8 100644 --- a/src/data.js +++ b/src/data.js @@ -122,8 +122,11 @@ Data.prototype = { }, discard: function( owner ) { var index = this.owners.indexOf( owner ); - this.owners.splice( index, 1 ); - this.cache.splice( index, 1 ); + + if ( index >= 0 ) { + this.owners.splice( index, 1 ); + this.cache.splice( index, 1 ); + } return this; } };