more robustness
parent
55ae1a2fe6
commit
17e580cdca
|
@ -8,4 +8,5 @@ import (
|
|||
|
||||
var (
|
||||
errNilReceiver = errors.New("Nil Receiver")
|
||||
errNilRouter = errors.New("Nil Router")
|
||||
)
|
||||
|
|
7
flog.go
7
flog.go
|
@ -28,5 +28,10 @@ func (flogger *internalFlogger) route(message string, moreContext map[string]int
|
|||
|
||||
context := newContext(flogger.context, moreContext)
|
||||
|
||||
return flogger.router.Route(message, context)
|
||||
router := flogger.router
|
||||
if nil == router {
|
||||
return errNilRouter
|
||||
}
|
||||
|
||||
return router.Route(message, context)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue