瀏覽代碼

build: fixed unit test failure

Torkel Ödegaard 8 年之前
父節點
當前提交
a00af85f36
共有 1 個文件被更改,包括 5 次插入1 次删除
  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) {