diff --git a/pkg/api/dashboard.go b/pkg/api/dashboard.go index 2e3013ef1c5..8a1f0f85c28 100644 --- a/pkg/api/dashboard.go +++ b/pkg/api/dashboard.go @@ -187,6 +187,7 @@ func PostDashboard(c *middleware.Context, cmd m.SaveDashboardCommand) Response { Message: cmd.Message, OrgId: c.OrgId, UserId: c.UserId, + Overwrite: cmd.Overwrite, } dashboard, err := dashboards.GetRepository().SaveDashboard(dashItem) 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) {