Bug check dropins for nil-pointers
@@ -1467,6 +1467,10 @@ func (dn *Daemon) writeUnits(units []ign3types.Unit) error {
for _, u := range units {
// write the dropin to disk
for i := range u.Dropins {
+ if u.Dropins[i].Contents == nil || *u.Dropins[i].Contents == "" {
+ glog.Infof("Dropin for %s has no content, skipping write", u.Dropins[i].Name)
+ continue
+ }
glog.Infof("Writing systemd unit dropin %q", u.Dropins[i].Name)
dpath := filepath.Join(pathSystemd, u.Name+".d", u.Dropins[i].Name)
if _, err := os.Stat("/usr" + dpath); err == nil &&
