12a65a5913e223f39eeec79baf459c537a6a769c — Louis Solofrizzo 16 days ago 79803b9
api: Add error check on instance list

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

M api/instance.go
M api/instance.go => api/instance.go +6 -1
@@ 24,7 24,12 @@ ipv6 = ""
  
  		DB.Find(&ipv4, "instance = ?", instance.Uuid)
- 		inst, _, _ := Context.LXD.GetInstanceState("LF" + instance.Uuid)
+ 		inst, _, err := Context.LXD.GetInstanceState("LF" + instance.Uuid)
+ 
+ 		if err != nil {
+ 			APIError(ctx, 500, err.Error())
+ 			return
+ 		}
  
  		for _, net := range inst.Network {
  			for _, addr := range net.Addresses {