Browse Source

build: fixed unit test failure

Torkel Ödegaard 8 years ago
parent
commit
a00af85f36
1 changed files with 5 additions and 1 deletions
  1. 5 1
      public/app/plugins/datasource/graphite/graphite_query.ts

+ 5 - 1
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) {