Skip to content

Commit

Permalink
Fix FindCoordinatorResponse.encode to allow nil Coordinator
Browse files Browse the repository at this point in the history
  • Loading branch information
horkhe committed Feb 14, 2018
1 parent 851e809 commit df01655
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion find_coordinator_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,18 @@ func (f *FindCoordinatorResponse) encode(pe packetEncoder) error {
}
}

if f.Coordinator == nil {
pe.putInt32(0)
pe.putString("")
pe.putInt32(0)
if f.Version >= 1 {
pe.putNullableString(nil)
}
return nil
}
if err := f.Coordinator.encode(pe, 0); err != nil {
return err
}

return nil
}

Expand Down

0 comments on commit df01655

Please sign in to comment.