From ea345c722387766ee1fb01f3b854772bf5c7ca28 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Sat, 5 Oct 2024 15:06:30 -0400 Subject: [PATCH] tunnel: fix crash from older tunnel version --- pkg/project/stack.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/project/stack.go b/pkg/project/stack.go index c7393aa1e..f24c40f5e 100644 --- a/pkg/project/stack.go +++ b/pkg/project/stack.go @@ -874,10 +874,13 @@ func getCompletedEvent(ctx context.Context, stack auto.Stack) (*CompleteEvent, e PrivateKey: match["privateKey"].(string), Subnets: []string{}, } - for _, subnet := range match["subnets"].([]interface{}) { - tunnel.Subnets = append(tunnel.Subnets, subnet.(string)) + subnets, ok := match["subnets"].([]interface{}) + if ok { + for _, subnet := range subnets { + tunnel.Subnets = append(tunnel.Subnets, subnet.(string)) + } + complete.Tunnels[resource.URN.Name()] = tunnel } - complete.Tunnels[resource.URN.Name()] = tunnel } if hint, ok := outputs["_hint"].(string); ok {