File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,13 +2,18 @@ package catalog
22
33import (
44 "context"
5+ "strings"
56
67 "google.golang.org/grpc/codes"
78 "google.golang.org/grpc/status"
89
910 configv1 "github.com/openkcm/plugin-sdk/proto/service/common/config/v1"
1011)
1112
13+ const (
14+ defaultEmptyBuildInfo = "{}"
15+ )
16+
1217type Configurers []* configurer
1318
1419type configurer struct {
@@ -42,14 +47,17 @@ func (c *configurer) Configure(ctx context.Context) error {
4247}
4348
4449func extractBuildInfo (resp * configv1.ConfigureResponse ) string {
45- value := "{}"
4650 defer func () {
47- if err := recover (); err != nil {
48- value = "{}"
49- }
51+ _ = recover ()
5052 }()
5153
52- value = resp .GetBuildInfo ()
54+ if resp == nil {
55+ return defaultEmptyBuildInfo
56+ }
5357
58+ value := strings .TrimSpace (resp .GetBuildInfo ())
59+ if value == "" {
60+ return defaultEmptyBuildInfo
61+ }
5462 return value
5563}
You can’t perform that action at this time.
0 commit comments