From c05e37de4572a5cd7375a5d5ce30d087dfb2ccf4 Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Tue, 7 Sep 2021 12:29:40 +0100 Subject: [PATCH] add default value for content --- infra/conf/v5cfg/common.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/infra/conf/v5cfg/common.go b/infra/conf/v5cfg/common.go index b5567ccfd..116d604d3 100644 --- a/infra/conf/v5cfg/common.go +++ b/infra/conf/v5cfg/common.go @@ -12,6 +12,9 @@ import ( func loadHeterogeneousConfigFromRawJson(interfaceType, name string, rawJson json.RawMessage) (proto.Message, error) { fsdef := envimpl.NewDefaultFileSystemDefaultImpl() ctx := envctx.ContextWithEnvironment(context.TODO(), fsdef) + if rawJson == nil || len(rawJson) == 0 { + rawJson = []byte("{}") + } return registry.LoadImplementationByAlias(ctx, interfaceType, name, []byte(rawJson)) }