Skip to content

Commit

Permalink
explore: fix null checks (grafana#17191)
Browse files Browse the repository at this point in the history
  • Loading branch information
marefr authored and davkal committed May 21, 2019
1 parent 3b35e9d commit 5414a31
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions public/app/features/explore/Logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default class Logs extends PureComponent<Props, State> {
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({
Expand All @@ -193,7 +193,9 @@ export default class Logs extends PureComponent<Props, State> {

// 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(),
Expand Down

0 comments on commit 5414a31

Please sign in to comment.