Skip to content

Commit

Permalink
Validate count is > 0 for Alert find APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Morgan committed Jul 13, 2009
1 parent eab981f commit 1fadbf3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hqu/hqapi1/app/AlertController.groovy
Expand Up @@ -41,6 +41,9 @@ public class AlertController extends ApiController {
} else if (begin >= end) {
failureXml = getFailureXML(ErrorCode.INVALID_PARAMETERS,
"Begin must be < end")
} else if (count <= 0) {
failureXml = getFailureXML(ErrorCode.INVALID_PARAMETERS,
"Count must ben > 0")
} else {
try {
Integer groupId = null
Expand Down Expand Up @@ -92,6 +95,9 @@ public class AlertController extends ApiController {
} else if (begin >= end) {
failureXml = getFailureXML(ErrorCode.INVALID_PARAMETERS,
"Begin must be < end")
} else if (count <= 0) {
failureXml = getFailureXML(ErrorCode.INVALID_PARAMETERS,
"Count must ben > 0")
} else {
try {
AlertSeverity severity = AlertSeverity.findByCode(sev)
Expand Down

0 comments on commit 1fadbf3

Please sign in to comment.