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 20e9b58
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion find_coordinator_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,22 @@ func (f *FindCoordinatorResponse) encode(pe packetEncoder) error {
}
}

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

return nil
}

Expand Down

0 comments on commit 20e9b58

Please sign in to comment.