From e7bf482eaa42acde0095c68cf4bdc35724981e56 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Tue, 30 Oct 2018 17:14:27 -0700 Subject: [PATCH] plugins: SetConfig shouldn't panic on nil driver configs --- plugins/base/server.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/base/server.go b/plugins/base/server.go index e9afd2641..82fd1c210 100644 --- a/plugins/base/server.go +++ b/plugins/base/server.go @@ -64,9 +64,11 @@ func (b *basePluginServer) SetConfig(ctx context.Context, req *proto.SetConfigRe cfg := nomadConfigFromProto(req.GetNomadConfig()) filteredCfg := new(ClientAgentConfig) - switch info.Type { - case PluginTypeDriver: - filteredCfg.Driver = cfg.Driver + if cfg != nil { + switch info.Type { + case PluginTypeDriver: + filteredCfg.Driver = cfg.Driver + } } // Set the config