Skip to content

Commit 8706316

Browse files
committed
types_gojay: fix keyID initialize
1 parent 19fe31c commit 8706316

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

types_gojay.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ func (r *WireRequest) UnmarshalJSONObject(dec *gojay.Decoder, k string) error {
7575
case keyJSONRPC:
7676
return dec.String(&r.JSONRPC)
7777
case keyID:
78+
if r.ID == nil {
79+
r.ID = &ID{}
80+
}
7881
s := r.ID.String()
7982
return dec.String(&s)
8083
case keyMethod:
@@ -114,6 +117,9 @@ func (r *WireResponse) UnmarshalJSONObject(dec *gojay.Decoder, k string) error {
114117
case keyJSONRPC:
115118
return dec.String(&r.JSONRPC)
116119
case keyID:
120+
if r.ID == nil {
121+
r.ID = &ID{}
122+
}
117123
s := r.ID.String()
118124
return dec.String(&s)
119125
case keyError:

0 commit comments

Comments
 (0)