Skip to content

Commit

Permalink
Pass processing if doc[field] == null (opensearch-project#361)
Browse files Browse the repository at this point in the history
Pass processing if doc[field] == null
Based on opendistro-for-elasticsearch/kibana-reports#327 (comment)
  • Loading branch information
uzhinskiy authored and zhongnansu committed May 24, 2021
1 parent 0399724 commit 22e5489
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dashboards-reports/server/routes/utils/dataReportHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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") ||
Expand Down

0 comments on commit 22e5489

Please sign in to comment.