Ignoring nil status descriptions in RPC package.

When a successful operation is returned, the description is nil. This case was causing RPC to always return as a failure.
This commit is contained in:
Martin Strobel 2018-10-15 15:48:32 -07:00
Родитель 9adb049049
Коммит 6d27bccbb4
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -188,7 +188,7 @@ func (l *Link) RPC(ctx context.Context, msg *amqp.Message) (*Response, error) {
for i := range descriptionCandidates {
if rawDescription, ok := res.ApplicationProperties[descriptionCandidates[i]]; ok {
descriptionFound = true
if description, ok = rawDescription.(string); ok {
if description, ok = rawDescription.(string); ok || rawDescription == nil {
break
} else {
return nil, errors.New("status description was not of expected type string")