Skip to content

Commit

Permalink
Fix potential nil crash
Browse files Browse the repository at this point in the history
If this errors, we can't derefence v and read this value. This was
broken in vitessio#13449

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
  • Loading branch information
dbussink committed Jul 12, 2023
1 parent 40979b6 commit 6cd0f34
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion go/vt/mysqlctl/grpcmysqlctlclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ func (c *client) VersionString(ctx context.Context) (string, error) {
var version string
err := c.withRetry(ctx, func() error {
r, err := c.c.VersionString(ctx, &mysqlctlpb.VersionStringRequest{})
if err != nil {
return err
}
version = r.Version
return err
return nil
})
return version, err
}
Expand Down

0 comments on commit 6cd0f34

Please sign in to comment.