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 hashicorp-ci
parent beae0f5b60
commit f0e2bc2a4e

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