diff options
Diffstat (limited to 'context.go')
-rw-r--r-- | context.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -441,6 +441,12 @@ func (ctx Context) App(name string) (any, error) { // or stop App modules. The caller is expected to assert to the // concrete type. func (ctx Context) AppIfConfigured(name string) any { + if ctx.cfg == nil { + // this can happen if the currently-active context + // is being accessed, but no config has successfully + // been loaded yet + return nil + } return ctx.cfg.apps[name] } |