From be8d1307a10cc924435a997d5e4c76fc9971b6d2 Mon Sep 17 00:00:00 2001 From: Tim Penhey Date: Wed, 11 Mar 2020 10:09:15 +1300 Subject: [PATCH] Protect against nil profile from the charm. --- apiserver/facades/agent/instancemutater/shim.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apiserver/facades/agent/instancemutater/shim.go b/apiserver/facades/agent/instancemutater/shim.go index 403d955e32a..a6fb4046f48 100644 --- a/apiserver/facades/agent/instancemutater/shim.go +++ b/apiserver/facades/agent/instancemutater/shim.go @@ -90,6 +90,9 @@ type charmShim struct { func (s *charmShim) LXDProfile() lxdprofile.Profile { profile := s.Charm.LXDProfile() + if profile == nil { + return lxdprofile.Profile{} + } return lxdprofile.Profile{ Config: profile.Config, Description: profile.Description,