[Lens] fix error when adding a new layer (#100766)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Marta Bondyra 2021-05-28 00:24:38 +02:00 committed by GitHub
parent 868e5df87d
commit 48f7a479b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -140,7 +140,7 @@ const getDataBounds = function (
let min = Number.MAX_VALUE;
let max = Number.MIN_VALUE;
axis.series.forEach((series) => {
activeData?.[series.layer].rows.forEach((row) => {
activeData?.[series.layer]?.rows.forEach((row) => {
const value = row[series.accessor];
if (!Number.isNaN(value)) {
if (value < min) {