Skip to content

Commit

Permalink
Revert "Ember.warn when ManyArray.objectAt() is underfined"
Browse files Browse the repository at this point in the history
This reverts commit 44ffbff.

More details: #4896 (comment)
  • Loading branch information
stefanpenner committed Apr 5, 2017
1 parent b03427f commit a5d1cd5
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions addon/-private/system/many-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@module ember-data
*/
import Ember from 'ember';
import { assert, warn } from "ember-data/-private/debug";
import { assert } from "ember-data/-private/debug";
import { PromiseArray } from "./promise-proxies";
import { _objectIsAlive } from "./store/common";
import diffArray from './diff-array';
Expand Down Expand Up @@ -135,13 +135,7 @@ export default Ember.Object.extend(Ember.MutableArray, Ember.Evented, {

objectAt(index) {
let internalModel = this.currentState[index];
//Ember observers such as 'firstObject', 'lastObject' might do out of bounds accesses
if (internalModel === undefined) {
warn(`ManyArray#objectAt(index) return undefined for index '${index}'. See https://github.com/emberjs/data/issues/4758`, false, {
id: 'ds.many-array.object-at-undefined'
});
return;
}
if (internalModel === undefined) { return; }

return internalModel.getRecord();
},
Expand Down

0 comments on commit a5d1cd5

Please sign in to comment.