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