From 22e5489c2ef70f62892e57f7c73d5a47801eeb06 Mon Sep 17 00:00:00 2001 From: Uzhinskiy Boris Date: Tue, 11 May 2021 19:36:31 +0300 Subject: [PATCH] Pass processing if doc[field] == null (#361) Pass processing if doc[field] == null Based on https://github.com/opendistro-for-elasticsearch/kibana-reports/issues/327#issuecomment-796479152 --- dashboards-reports/server/routes/utils/dataReportHelpers.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dashboards-reports/server/routes/utils/dataReportHelpers.ts b/dashboards-reports/server/routes/utils/dataReportHelpers.ts index f20acc96..3b56f6ed 100644 --- a/dashboards-reports/server/routes/utils/dataReportHelpers.ts +++ b/dashboards-reports/server/routes/utils/dataReportHelpers.ts @@ -235,6 +235,8 @@ function traverse(data, keys, result = {}) { */ function sanitize(doc: any) { for (const field in doc) { + if (doc[field] == null) + continue if ( doc[field].toString().startsWith('+') || (doc[field].toString().startsWith('-') && typeof doc[field] !== "number") ||