Skip to content

Commit

Permalink
fix nil handling for legacy servers
Browse files Browse the repository at this point in the history
  • Loading branch information
erratic-pattern committed Apr 13, 2024
1 parent 64088a2 commit c4aab03
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion go/arrow/flight/flightsql/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1236,10 +1236,17 @@ func (p *PreparedStatement) captureDoPutPreparedStatementHandle(pstream pb.Fligh
if result, err = pstream.Recv(); err != nil && err != io.EOF {
return err
}
// skip if server does not provide a response (legacy server)
if result == nil {
return nil
}
if err = proto.Unmarshal(result.GetAppMetadata(), &preparedStatementResult); err != nil {
return err
}
p.handle = preparedStatementResult.GetPreparedStatementHandle()
handle := preparedStatementResult.GetPreparedStatementHandle()
if handle != nil {
p.handle = handle
}
return nil
}

Expand Down

0 comments on commit c4aab03

Please sign in to comment.