summaryrefslogtreecommitdiff
path: root/plugins/http
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-18 21:45:30 +0300
committerValery Piashchynski <[email protected]>2021-01-18 21:45:30 +0300
commit7e5d09e30986f7823b591c58eb858f100382b81f (patch)
tree887374374fc4aa91fe13df3b505273c8c858e12e /plugins/http
parenta9a206b31e272e0508fff496e9641c4db291ddb7 (diff)
Fix NPE when .rr.yaml didn't contain HTTP section
Add tests
Diffstat (limited to 'plugins/http')
-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)