Don't read properties off of null objects

Somehow this controller code runs sometimes when the existing jobs
are dematerializing. This makes this.get('model') and array of null
This commit is contained in:
Michael Lange 2018-04-12 12:56:06 -07:00
parent 1f300eb4fb
commit 5223a3f816

View file

@ -40,6 +40,7 @@ export default Controller.extend(Sortable, Searchable, {
const activeNamespace = this.get('system.activeNamespace.id') || 'default';
return this.get('model')
.compact()
.filter(job => !hasNamespaces || job.get('namespace.id') === activeNamespace)
.filter(job => !job.get('parent.content'));
}