소스 검색

stackdriver: check if array is empty to prevent filter from crashing. This closes #13607

Erik Sundell 7 년 전
부모
커밋
c84cf1f598
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);
     }
   }