Skip to content

Commit

Permalink
Merge pull request #93 from piemapping/master
Browse files Browse the repository at this point in the history
Avoid nil exception when the response from opsgenie is empty
  • Loading branch information
darkcrux committed Jan 22, 2016
2 parents d62c482 + 3ddfca6 commit 18bd8d9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions notifier/opsgenie-notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ func (opsgenie *OpsGenieNotifier) Notify(messages Messages) bool {
response, alertErr := opsgenie.Send(alertCli, title, content)

if alertErr != nil {
log.Println("Opsgenie notification trouble.", response.Status)
return false
}

if response == nil {
log.Println("Opsgenie notification trouble", alertErr)
} else {
log.Println("Opsgenie notification trouble.", response.Status)
}
return false
}
}

log.Println("Opsgenie notification send.")
Expand Down

0 comments on commit 18bd8d9

Please sign in to comment.