Skip to content
This repository has been archived by the owner on Feb 13, 2025. It is now read-only.

Commit

Permalink
Don't try to load metrics definition file with an empty filename.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannig committed Oct 9, 2020
1 parent c2815aa commit facb5fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ func hashFile(h hash.Hash, fn string) error {

func checkIfMetricsChanged() bool {
for i, _customMetrics := range strings.Split(*customMetrics, ",") {
if len(_customMetrics) == 0 {
continue
}
log.Debug("Checking modifications in following metrics definition file:", _customMetrics)
h := sha256.New()
if err := hashFile(h, _customMetrics); err != nil {
log.Errorln("Unable to get file hash", err)
Expand Down

0 comments on commit facb5fd

Please sign in to comment.