more robustness

master
Charles Iliya Krempeaux 2016-09-20 11:15:32 -07:00
parent 55ae1a2fe6
commit 17e580cdca
2 changed files with 7 additions and 1 deletions

View File

@ -8,4 +8,5 @@ import (
var (
errNilReceiver = errors.New("Nil Receiver")
errNilRouter = errors.New("Nil Router")
)

View File

@ -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)
}