From 19df00e2d4171b6e26256a33f438cb9120c1f924 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 11 Oct 2018 15:10:47 +0200 Subject: [PATCH] stackdriver: check if array is empty to prevent filter from crashing. This closes #13607 (cherry picked from commit c84cf1f598cfbb9f0fa719154762e287e1a917b5) --- public/app/plugins/datasource/stackdriver/filter_segments.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/stackdriver/filter_segments.ts b/public/app/plugins/datasource/stackdriver/filter_segments.ts index 8d193f663c2..9eb27f31975 100644 --- a/public/app/plugins/datasource/stackdriver/filter_segments.ts +++ b/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); } }