瀏覽代碼

Merge pull request #13624 from grafana/filter-option-fix

Stackdriver: Prevent filter from crashing
Daniel Lee 7 年之前
父節點
當前提交
09c9c2a57b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      public/app/plugins/datasource/stackdriver/filter_segments.ts

+ 1 - 1
public/app/plugins/datasource/stackdriver/filter_segments.ts

@@ -87,7 +87,7 @@ export class FilterSegments {
     }
 
     // remove condition if it is first segment
-    if (index === 0 && this.filterSegments[0].type === 'condition') {
+    if (index === 0 && this.filterSegments.length > 0 && this.filterSegments[0].type === 'condition') {
       this.filterSegments.splice(0, 1);
     }
   }