app/vmalert: properly handle nil req passed to requestToCurl()

This fixes a panic in the TestAlertingRule_Exec_Negative test.
The panic has been introduced in the commit b97bd01605
This commit is contained in:
Aliaksandr Valialkin 2022-12-10 02:04:15 -08:00
parent c5dd973f9c
commit 6f0179405a
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -72,7 +72,7 @@ func (cw *curlWriter) add(str string) {
}
func requestToCurl(req *http.Request) string {
if req.URL == nil {
if req == nil || req.URL == nil {
return ""
}