mirror of
https://github.com/spf13/viper
synced 2025-05-07 04:37:20 +00:00
Fix nil pointer on watch function (#568)
This commit is contained in:
parent
b5e8006cbe
commit
a1b8372762
1 changed files with 3 additions and 1 deletions
4
viper.go
4
viper.go
|
@ -289,7 +289,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…
Add table
Reference in a new issue