summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-18 23:20:39 +0300
committerGitHub <[email protected]>2021-01-18 23:20:39 +0300
commit8704e833dffd7d41614830b5347ba15fa9f297fd (patch)
tree3672285982b1f43212ffdb5d9958b6cc66774087 /plugins
parenta9a206b31e272e0508fff496e9641c4db291ddb7 (diff)
parent6d2c56b7fb8d33a4a8dcb2dad5d60e422c55d4df (diff)
Merge pull request #485 from spiral/bug/nil_http_config
bug(http): NPE when config didn't contain HTTP section
Diffstat (limited to 'plugins')
-rw-r--r--plugins/http/plugin.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/http/plugin.go b/plugins/http/plugin.go
index 222bf852..2e00a91a 100644
--- a/plugins/http/plugin.go
+++ b/plugins/http/plugin.go
@@ -77,6 +77,11 @@ func (s *Plugin) Init(cfg config.Configurer, log logger.Logger, server server.Se
return errors.E(op, err)
}
+ // if no HTTP section in config - disable HTTP
+ if s.cfg == nil {
+ return errors.E(op, errors.Disabled)
+ }
+
err = s.cfg.InitDefaults()
if err != nil {
return errors.E(op, err)