2e180d967a9c17fa7c09cd70cf2152b101ec9aa4 — Louis Solofrizzo 6 months ago bd31e7c
api: Fix crash on image list

Signed-off-by: Louis Solofrizzo <lsolofrizzo@online.net>
2 files changed, 5 insertions(+), 3 deletions(-)

M api/images.go
M deploy/lxd/lxd.service
M api/images.go => api/images.go +4 -2
@@ 17,8 17,10 @@   	for _, img := range images {
  		if img.Public {
- 			if name == img.Aliases[0].Name {
- 				return nil
+ 			if len(img.Aliases) > 0 {
+ 				if name == img.Aliases[0].Name {
+ 					return nil
+ 				}
  			}
  		}
  	}

M deploy/lxd/lxd.service => deploy/lxd/lxd.service +1 -1
@@ 6,7 6,7 @@ Type=simple
  User=root
  LimitNOFILE=64000
- ExecStart=/usr/bin/lxd --debug
+ ExecStart=/usr/bin/lxd
  Restart=always
  
  [Install]