mirror of
https://github.com/spf13/viper
synced 2024-12-22 11:37:02 +00:00
Fix nil pointer on watch function (#568)
This commit is contained in:
parent
3171ef9a22
commit
2c12c60302
1 changed files with 3 additions and 1 deletions
2
viper.go
2
viper.go
|
@ -306,9 +306,11 @@ func (v *Viper) WatchConfig() {
|
|||
if err != nil {
|
||||
log.Println("error:", err)
|
||||
}
|
||||
if v.onConfigChange != nil {
|
||||
v.onConfigChange(event)
|
||||
}
|
||||
}
|
||||
}
|
||||
case err := <-watcher.Errors:
|
||||
log.Println("error:", err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue