From b5cee7f746da9b3888250bd37eb4c17f4af1ef59 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Guerraz Date: Tue, 9 Feb 2021 01:04:36 +0100 Subject: [PATCH] Default intervals to grafana intervals - fix for SQL query type --- src/QueryEditor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/QueryEditor.tsx b/src/QueryEditor.tsx index 394e706..0c2d8d5 100644 --- a/src/QueryEditor.tsx +++ b/src/QueryEditor.tsx @@ -32,7 +32,7 @@ export class QueryEditor extends PureComponent { const { query, onChange, onRunQuery } = this.props; //todo: need to implement some kind of hook system to alter a query from modules - if (queryBuilderOptions.builder.intervals.length === 0) { + if (Array.isArray(queryBuilderOptions.builder.intervals) && queryBuilderOptions.builder.intervals.length === 0) { queryBuilderOptions.builder.intervals.push('${__from:date:iso}/${__to:date:iso}'); } //workaround (https://github.com/grafana/grafana/issues/30013)