Skip to content

Commit

Permalink
prevent zalgo modelClass lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Nov 30, 2016
1 parent c54e7a1 commit aa86e09
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions addon/-private/system/class-meta.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import EmptyObject from 'ember-data/-private/system/empty-object';

const NULL_RESOLUTION = new EmptyObject();

export default class ClassMeta {
constructor(store, modelName) {
this.modelName = modelName;
Expand All @@ -24,10 +26,10 @@ export default class ClassMeta {

get modelClass() {
if (!this._modelClass) {
this._modelClass = this._store.modelFor(this.modelName);
this._modelClass = this._store.modelFor(this.modelName) || NULL_RESOLUTION;
}

return this._modelClass;
return this._modelClass === NULL_RESOLUTION ? null : this._modelClass;
}

/* deprecated way of accessing modelClass */
Expand Down

0 comments on commit aa86e09

Please sign in to comment.