Data: Verify we have an interval array before accessing. (https://github.com/woocommerce/woocommerce-admin/pull/5546)

This commit is contained in:
Timmy Crawford 2020-11-06 08:33:57 -08:00 committed by GitHub
parent 6ae4c5fbfd
commit fbfb1dc86b
1 changed files with 7 additions and 1 deletions

View File

@ -369,7 +369,13 @@ export function getReportChartData( options ) {
}
forEach( pagedData, function ( _data ) {
if (
_data.data &&
_data.data.intervals &&
Array.isArray( _data.data.intervals )
) {
intervals = intervals.concat( _data.data.intervals );
}
} );
}