Skip to content

Commit

Permalink
Fix a panic by gnmi subscribe with invalid xpath
Browse files Browse the repository at this point in the history
  • Loading branch information
wumiaont committed Oct 17, 2024
1 parent 743c7af commit 80067ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gnmi_server/client_subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,13 @@ func (c *Client) Run(stream gnmipb.GNMI_SubscribeServer) (err error) {
/* For any other target or no target create new Transl Client. */
dc, err = sdc.NewTranslClient(prefix, paths, ctx, extensions, sdc.TranslWildcardOption{})
}
defer dc.Close()

if err != nil {
return grpc.Errorf(codes.NotFound, "%v", err)
}

defer dc.Close()

switch mode {
case gnmipb.SubscriptionList_STREAM:
c.stop = make(chan struct{}, 1)
Expand Down

0 comments on commit 80067ec

Please sign in to comment.