Skip to content

Commit ef771c6

Browse files
committed
Improved error handling
1 parent a9e5756 commit ef771c6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/monitors/uptimerobot/uptime-monitor_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ func TestUpdateMonitorInterval(t *testing.T) {
145145

146146
service := UpTimeMonitorService{}
147147
provider := util.GetProviderWithName(config, "UptimeRobot")
148+
if provider == nil {
149+
return
150+
}
148151
service.Setup(*provider)
149152

150153
configInterval := &endpointmonitorv1alpha1.UptimeRobotConfig{
@@ -307,6 +310,9 @@ func TestAddMonitorWithMonitorType(t *testing.T) {
307310

308311
service := UpTimeMonitorService{}
309312
provider := util.GetProviderWithName(config, "UptimeRobot")
313+
if provider == nil {
314+
return
315+
}
310316
service.Setup(*provider)
311317

312318
configKeyword := &endpointmonitorv1alpha1.UptimeRobotConfig{
@@ -353,6 +359,9 @@ func TestAddMonitorWithIncorrectValues(t *testing.T) {
353359

354360
service := UpTimeMonitorService{}
355361
provider := util.GetProviderWithName(config, "UptimeRobot")
362+
if provider == nil {
363+
return
364+
}
356365
provider.ApiKey = "dummy-api-key"
357366
service.Setup(*provider)
358367

@@ -375,6 +384,9 @@ func TestAddMonitorWithAlertContacts(t *testing.T) {
375384

376385
service := UpTimeMonitorService{}
377386
provider := util.GetProviderWithName(config, "UptimeRobot")
387+
if provider == nil {
388+
return
389+
}
378390
service.Setup(*provider)
379391

380392
configAlertContacts := &endpointmonitorv1alpha1.UptimeRobotConfig{

0 commit comments

Comments
 (0)