From 7541292f683fa943740d7eeaabbe462ade3e9a2a Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 23 Jul 2024 17:33:38 +0800 Subject: [PATCH] :bug: Fix panic at adding services --- pkg/internal/grpc/services.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/internal/grpc/services.go b/pkg/internal/grpc/services.go index 4c13f81..5255307 100644 --- a/pkg/internal/grpc/services.go +++ b/pkg/internal/grpc/services.go @@ -3,6 +3,7 @@ package grpc import ( "context" "fmt" + "git.solsynth.dev/hydrogen/dealer/pkg/internal/directory" "git.solsynth.dev/hydrogen/dealer/pkg/proto" "github.com/rs/zerolog/log" @@ -10,6 +11,9 @@ import ( ) func warpServiceInstanceToInfo(in *directory.ServiceInstance) *proto.ServiceInfo { + if in == nil { + return nil + } return &proto.ServiceInfo{ Id: in.ID, Type: in.Type,