This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 774740e67e Grafana Plugin: fixed NPE when switching query style (#5825)
774740e67e is described below

commit 774740e67e0da0494f6b40bcb8995ea5578c9e6f
Author: CloudWise-Lukemiao 
<[email protected]>
AuthorDate: Sun May 8 23:00:59 2022 +0800

    Grafana Plugin: fixed NPE when switching query style (#5825)
---
 grafana-plugin/src/QueryEditor.tsx | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/grafana-plugin/src/QueryEditor.tsx 
b/grafana-plugin/src/QueryEditor.tsx
index 6027359582..0af54a87cf 100644
--- a/grafana-plugin/src/QueryEditor.tsx
+++ b/grafana-plugin/src/QueryEditor.tsx
@@ -207,9 +207,11 @@ export class QueryEditor extends PureComponent<Props, 
State> {
                   if (value === selectRaw[0]) {
                     this.props.query.aggregated = selectRaw[0];
                     this.props.query.aggregateFun = '';
-                    const nextTimeSeries = this.props.query.paths.filter((_, 
i) => i < 0);
-                    const nextOptions = this.props.query.options.filter((_, i) 
=> i < 0);
-                    this.onTimeSeriesChange(nextTimeSeries, nextOptions, true);
+                    if (this.props.query.paths) {
+                      const nextTimeSeries = this.props.query.paths.filter((_, 
i) => i < 0);
+                      const nextOptions = this.props.query.options.filter((_, 
i) => i < 0);
+                      this.onTimeSeriesChange(nextTimeSeries, nextOptions, 
true);
+                    }
                     if (this.props.query.groupBy?.samplingInterval) {
                       this.props.query.groupBy.samplingInterval = '';
                     }

Reply via email to