Skip to content

Commit cee73e4

Browse files
committed
Handle failed requests
1 parent 6847eb0 commit cee73e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

x-pack/platform/plugins/shared/streams_app/public/components/stream_list_view/data_quality_column.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ export function DataQualityColumn({
8585
}
8686
);
8787

88-
const docCount = Number(totalDocsQueryFetch?.value?.values?.[0]?.[0]);
89-
const degradedDocCount = Number(degradedDocsQueryFetch?.value?.values?.[0]?.[0]);
90-
const failedDocCount = Number(failedDocsQueryFetch?.value?.values?.[0]?.[0]);
88+
const docCount = totalDocsQueryFetch?.value ? Number(totalDocsQueryFetch.value?.values?.[0]?.[0]) : 0;
89+
const degradedDocCount = degradedDocsQueryFetch?.value ? Number(degradedDocsQueryFetch.value?.values?.[0]?.[0]) : 0;
90+
const failedDocCount = failedDocsQueryFetch?.value ? Number(failedDocsQueryFetch.value.values?.[0]?.[0]) : 0;
9191

9292
const degradedPercentage = calculatePercentage({
9393
totalDocs: docCount,

0 commit comments

Comments
 (0)