From 5414a3110107f9d3a3d1bf3822e48b9ce40469d4 Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Tue, 21 May 2019 09:37:31 +0200 Subject: [PATCH] explore: fix null checks (#17191) --- public/app/features/explore/Logs.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/app/features/explore/Logs.tsx b/public/app/features/explore/Logs.tsx index 3719ed0e88f..f12830b63b7 100644 --- a/public/app/features/explore/Logs.tsx +++ b/public/app/features/explore/Logs.tsx @@ -175,7 +175,7 @@ export default class Logs extends PureComponent { const hasLabel = hasData && dedupedData.hasUniqueLabels; const dedupCount = dedupedData.rows.reduce((sum, row) => sum + row.duplicates, 0); const showDuplicates = dedupStrategy !== LogsDedupStrategy.none && dedupCount > 0; - const meta = [...data.meta]; + const meta = data.meta ? [...data.meta] : []; if (dedupStrategy !== LogsDedupStrategy.none) { meta.push({ @@ -193,7 +193,9 @@ export default class Logs extends PureComponent { // React profiler becomes unusable if we pass all rows to all rows and their labels, using getter instead const getRows = () => processedRows; - const timeSeries = data.series.map(series => new TimeSeries(series)); + const timeSeries = data.series + ? data.series.map(series => new TimeSeries(series)) + : [new TimeSeries({ datapoints: [] })]; const absRange = { from: range.from.valueOf(), to: range.to.valueOf(),