Skip to content

Commit

Permalink
fix cannot read property 'forEach' of null charts (#7847)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntheanh201 authored Nov 1, 2023
1 parent 747a3cd commit 5d4db51
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ var ChartBPSController = function(deliveryService, $scope, $timeout, $filter, $q
var normalizedChartData = [];

if (angular.isDefined(series)) {
series.values.forEach(function(seriesItem) {
series.values?.forEach(function(seriesItem) {
if (moment(seriesItem[0]).isSame(start) || moment(seriesItem[0]).isAfter(start)) {
normalizedChartData.push([ moment(seriesItem[0]).valueOf(),
numberUtils.convertTo(seriesItem[1], $scope.unitSize) ]); // converts data to appropriate unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ var ChartHttpStatusController = function(deliveryService, $scope, $timeout, $fil
series = result.series;

if (angular.isDefined(series)) {
series.values.forEach(function(seriesItem) {
series.values?.forEach(function(seriesItem) {
if (moment(seriesItem[0]).isSame(start) || moment(seriesItem[0]).isAfter(start)) {
if (_.isNumber(seriesItem[1])) {
normalizedChartData.push([ moment(seriesItem[0]).valueOf(), seriesItem[1] ]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var ChartTPSController = function(deliveryService, $scope, $timeout, $filter, $q
var normalizedChartData = [];

if (angular.isDefined(series)) {
series.values.forEach(function(seriesItem) {
series.values?.forEach(function(seriesItem) {
if (moment(seriesItem[0]).isSame(start) || moment(seriesItem[0]).isAfter(start)) {
normalizedChartData.push([ moment(seriesItem[0]).valueOf(), seriesItem[1] ]);
}
Expand Down

0 comments on commit 5d4db51

Please sign in to comment.