ui: Check for a non-existent items argument/attribute within DataCollection (#9662)

This commit is contained in:
John Cowen 2021-01-29 15:53:28 +00:00 committed by GitHub
parent 7c277aa85b
commit 19fd9a87d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -104,10 +104,11 @@ export default class DataCollectionComponent extends Component {
// TODO: Temporary little hack to ensure we detect DataSource proxy
// objects but not any other special Ember Proxy object like ember-data
// things. Remove this once we no longer need the Proxies
if (this.args.items.dispatchEvent === 'function') {
return this.args.items.content;
const items = this.args.items || [];
if (typeof items.dispatchEvent === 'function') {
return items.content;
}
return this.args.items;
return items;
}
@action