From 368eb03e200b755870f1ad373e67561201ab6f31 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 --- kibana-reports/server/routes/utils/dataReportHelpers.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kibana-reports/server/routes/utils/dataReportHelpers.ts b/kibana-reports/server/routes/utils/dataReportHelpers.ts index bdda8d3f..296a2a25 100644 --- a/kibana-reports/server/routes/utils/dataReportHelpers.ts +++ b/kibana-reports/server/routes/utils/dataReportHelpers.ts @@ -223,6 +223,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('-') ||