forked from mirror/viper
Fix nil pointer on watch function
This commit is contained in:
parent
3171ef9a22
commit
a8d2f21f14
4
viper.go
4
viper.go
|
@ -306,7 +306,9 @@ func (v *Viper) WatchConfig() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("error:", err)
|
log.Println("error:", err)
|
||||||
}
|
}
|
||||||
v.onConfigChange(event)
|
if v.onConfigChange != nil {
|
||||||
|
v.onConfigChange(event)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case err := <-watcher.Errors:
|
case err := <-watcher.Errors:
|
||||||
|
|
Loading…
Reference in New Issue