From fbfb1dc86be921d7a527d3eb6b513c344e228e73 Mon Sep 17 00:00:00 2001 From: Timmy Crawford Date: Fri, 6 Nov 2020 08:33:57 -0800 Subject: [PATCH] Data: Verify we have an interval array before accessing. (https://github.com/woocommerce/woocommerce-admin/pull/5546) --- .../woocommerce-admin/packages/data/src/reports/utils.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/woocommerce-admin/packages/data/src/reports/utils.js b/plugins/woocommerce-admin/packages/data/src/reports/utils.js index 9e7f2e76f31..519f36ab97d 100644 --- a/plugins/woocommerce-admin/packages/data/src/reports/utils.js +++ b/plugins/woocommerce-admin/packages/data/src/reports/utils.js @@ -369,7 +369,13 @@ export function getReportChartData( options ) { } forEach( pagedData, function ( _data ) { - intervals = intervals.concat( _data.data.intervals ); + if ( + _data.data && + _data.data.intervals && + Array.isArray( _data.data.intervals ) + ) { + intervals = intervals.concat( _data.data.intervals ); + } } ); }