diff options
Diffstat (limited to 'plugins/static/plugin.go')
-rw-r--r-- | plugins/static/plugin.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/static/plugin.go b/plugins/static/plugin.go index 6331037c..fa2bcfbe 100644 --- a/plugins/static/plugin.go +++ b/plugins/static/plugin.go @@ -29,11 +29,18 @@ type Plugin struct { // misconfiguration. Services must not be used without proper configuration pushed first. func (s *Plugin) Init(cfg config.Configurer, log logger.Logger) error { const op = errors.Op("static_plugin_init") + if !cfg.Has(RootPluginName) { + return errors.E(op, errors.Disabled) + } err := cfg.UnmarshalKey(RootPluginName, &s.cfg) if err != nil { return errors.E(op, errors.Disabled, err) } + if s.cfg.Static == nil { + return errors.E(op, errors.Disabled) + } + s.log = log s.root = http.Dir(s.cfg.Static.Dir) |