Fix nil pointer dereference when err is nil

master
Harshavardhana 10 years ago
parent e8d35258f1
commit 0f8021abd1
  1. 6
      pkg/drivers/donut/donut.go

@ -48,9 +48,11 @@ func Start(path string) (chan<- string, <-chan error, drivers.Driver) {
// TODO donut driver should be passed in as Start param and driven by config
var err *iodine.Error
s.donut, err = donut.NewDonut(path)
err = err.Annotate(map[string]string{"path": path})
if err != nil {
log.Println(err.EmitHumanReadable())
err = err.Annotate(map[string]string{"path": path})
if err != nil {
log.Println(err.EmitHumanReadable())
}
}
go start(ctrlChannel, errorChannel, s)

Loading…
Cancel
Save