Fix Error 500 on unexisting /api/alert-notification/<id>

This commit is contained in:
Sofia Papagiannaki
2019-01-13 21:30:20 +02:00
parent 8f5300dd2a
commit 8def73ba13
2 changed files with 10 additions and 0 deletions
+4
View File
@@ -212,6 +212,10 @@ func GetAlertNotificationByID(c *m.ReqContext) Response {
return Error(500, "Failed to get alert notifications", err)
}
if query.Result == nil {
return Error(404, "Alert notification not found", nil)
}
return JSON(200, dtos.NewAlertNotification(query.Result))
}