Skip to content

Commit

Permalink
BUGFIX: Panic when enabling/disabling monitors 🪲
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-uk committed Apr 2, 2023
1 parent b2b2ce0 commit bfe8b6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion services/runner/monitor/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (m *Monitor) runHTTP() (*types.Result, map[string]any) {
}

match := re.FindStringSubmatch(bodyStr)
if match != nil && len(match) > 1 {
if len(match) > 1 {
regexMatch = match[1]
}
}
Expand Down
5 changes: 4 additions & 1 deletion services/runner/monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,8 @@ func (m *Monitor) run() (bool, *types.Result) {

func (m *Monitor) Stop() {
log.Println("### Stopping monitor", m.Name)
m.ticker.Stop()

if m.ticker != nil {
m.ticker.Stop()
}
}

0 comments on commit bfe8b6d

Please sign in to comment.