Skip to content

Commit

Permalink
Check not nil
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbraemer committed Oct 22, 2022
1 parent c7715bd commit 4926b04
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ws/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ func (e *dialErr) Error() string {
func (e *dialErr) Unwrap() error { return e.error }

func mdFromContext(ctx context.Context) metadata.MD {
if ctx == nil {
return nil
}
md, _ := metadata.FromOutgoingContext(ctx)
return md
}

0 comments on commit 4926b04

Please sign in to comment.