From 19fd9a87d10adc5482cad4461e761b21fde51467 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Fri, 29 Jan 2021 15:53:28 +0000 Subject: [PATCH] ui: Check for a non-existent items argument/attribute within DataCollection (#9662) --- .../consul-ui/app/components/data-collection/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/packages/consul-ui/app/components/data-collection/index.js b/ui/packages/consul-ui/app/components/data-collection/index.js index 49780a957e..cff4bfba9d 100644 --- a/ui/packages/consul-ui/app/components/data-collection/index.js +++ b/ui/packages/consul-ui/app/components/data-collection/index.js @@ -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