mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 15:36:41 -05:00
add default value for content
This commit is contained in:
parent
6c934f9db0
commit
c05e37de45
@ -12,6 +12,9 @@ import (
|
|||||||
func loadHeterogeneousConfigFromRawJson(interfaceType, name string, rawJson json.RawMessage) (proto.Message, error) {
|
func loadHeterogeneousConfigFromRawJson(interfaceType, name string, rawJson json.RawMessage) (proto.Message, error) {
|
||||||
fsdef := envimpl.NewDefaultFileSystemDefaultImpl()
|
fsdef := envimpl.NewDefaultFileSystemDefaultImpl()
|
||||||
ctx := envctx.ContextWithEnvironment(context.TODO(), fsdef)
|
ctx := envctx.ContextWithEnvironment(context.TODO(), fsdef)
|
||||||
|
if rawJson == nil || len(rawJson) == 0 {
|
||||||
|
rawJson = []byte("{}")
|
||||||
|
}
|
||||||
return registry.LoadImplementationByAlias(ctx, interfaceType, name, []byte(rawJson))
|
return registry.LoadImplementationByAlias(ctx, interfaceType, name, []byte(rawJson))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user