From a00af85f36e53be6824e6c21652f45de122861cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 12 Dec 2017 13:21:50 +0100 Subject: [PATCH] build: fixed unit test failure --- public/app/plugins/datasource/graphite/graphite_query.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/graphite/graphite_query.ts b/public/app/plugins/datasource/graphite/graphite_query.ts index 824b49f8860..a1c4a889efb 100644 --- a/public/app/plugins/datasource/graphite/graphite_query.ts +++ b/public/app/plugins/datasource/graphite/graphite_query.ts @@ -121,7 +121,11 @@ export default class GraphiteQuery { } hasSelectMetric() { - return this.segments[this.segments.length - 1].value === 'select metric'; + if (this.segments.length > 0) { + return this.segments[this.segments.length - 1].value === 'select metric'; + } else { + return false; + } } addFunction(newFunc) {