Skip to content

Commit

Permalink
prevent segmentation violation if request fails
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Blaschke <[email protected]>
  • Loading branch information
mblaschke committed Aug 27, 2021
1 parent cee9d9e commit 0d4b1e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion metrics/insights.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ func (p *MetricProber) FetchMetricsFromTarget(client *insights.MetricsClient, ta
insights.Data,
p.settings.MetricNamespace,
)
p.logger.Debugf("sent request to %s", result.Request.URL.String())

if err == nil {
if result.Request.URL != nil {
p.logger.Debugf("sent request to %s", result.Request.URL.String())
}
ret.Result = &result
ret.ResourceID = &target.ResourceId
}
Expand Down

0 comments on commit 0d4b1e1

Please sign in to comment.