fix nil check

This commit is contained in:
marwan-at-work 2019-08-06 13:57:00 -04:00
parent cee005ee62
commit 1f7d1684b8

View File

@ -29,7 +29,7 @@ type Context struct {
func NewContext(app *App, set *flag.FlagSet, parentCtx *Context) *Context {
c := &Context{App: app, flagSet: set, parentContext: parentCtx}
if parentCtx != nil {
if parentCtx.Context != nil {
if parentCtx.Context == nil {
parentCtx.Context = context.Background()
}
c.Context = parentCtx.Context