build: fixed unit test failure

This commit is contained in:
Torkel Ödegaard 2017-12-12 13:21:50 +01:00
parent ff1b71bc20
commit a00af85f36

View File

@ -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) {