Skip to content

Commit

Permalink
Add a nil check for error to be on the safe side
Browse files Browse the repository at this point in the history
  • Loading branch information
khaf committed Jul 27, 2022
1 parent 4344fff commit b6b5865
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion command.go
Original file line number Diff line number Diff line change
Expand Up @@ -2448,7 +2448,7 @@ func (cmd *baseCommand) executeAt(ifc command, policy *BasePolicy, isRead bool,
}

if notFirstIteration {
if !ifc.prepareRetry(ifc, isClientTimeout || err.Matches(types.SERVER_NOT_AVAILABLE)) {
if !ifc.prepareRetry(ifc, isClientTimeout || (err != nil && err.Matches(types.SERVER_NOT_AVAILABLE))) {
if bc, ok := ifc.(batcher); ok {
// Batch may be retried in separate commands.
alreadyRetried, err := bc.retryBatch(bc, cmd.node.cluster, deadline, cmd.commandSentCounter, commandSentCounter)
Expand Down

0 comments on commit b6b5865

Please sign in to comment.