Skip to content

Commit 63af46e

Browse files
committed
rpc: initialize 'servers' field in rpc_discover method
Fixes ethereum#29
1 parent bd61166 commit 63af46e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rpc/server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ func (s *RPCService) Discover() (schema *OpenRPCDiscoverSchemaT, err error) {
219219
if s.server.OpenRPCSchemaRaw == "" {
220220
return nil, errOpenRPCDiscoverUnavailable
221221
}
222-
schema = &OpenRPCDiscoverSchemaT{}
222+
schema = &OpenRPCDiscoverSchemaT{
223+
Servers: make([]map[string]interface{}, 0),
224+
}
223225
err = json.Unmarshal([]byte(s.server.OpenRPCSchemaRaw), schema)
224226
if err != nil {
225227
log.Crit("openrpc json umarshal", "error", err)

0 commit comments

Comments
 (0)