Skip to content

Commit

Permalink
bug #2095 - verify for empty error string even if it is a nullable st…
Browse files Browse the repository at this point in the history
…ring
  • Loading branch information
agriffaut committed Dec 29, 2021
1 parent 6a2f0c2 commit a1807bf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ func (ca *clusterAdmin) DescribeClientQuotas(components []QuotaFilterComponent,
return nil, err
}

if rsp.ErrorMsg != nil {
if rsp.ErrorMsg != nil && len(*rsp.ErrorMsg) > 0 {
return nil, errors.New(*rsp.ErrorMsg)
}
if rsp.ErrorCode != ErrNoError {
Expand Down Expand Up @@ -1157,6 +1157,9 @@ func (ca *clusterAdmin) AlterClientQuotas(entity []QuotaEntityComponent, op Clie
}

for _, entry := range rsp.Entries {
if entry.ErrorMsg != nil && len(*entry.ErrorMsg) > 0 {
return errors.New(*entry.ErrorMsg)
}
if entry.ErrorCode != ErrNoError {
return entry.ErrorCode
}
Expand Down

0 comments on commit a1807bf

Please sign in to comment.