Browse Source

Fix possible conversion exceptions in primitive types. #568

master
Savorboard 4 years ago
parent
commit
5e40172c58
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      src/DotNetCore.CAP/Internal/ISubscribeInvoker.Default.cs

+ 8
- 1
src/DotNetCore.CAP/Internal/ISubscribeInvoker.Default.cs View File

@@ -62,7 +62,14 @@ namespace DotNetCore.CAP.Internal
else
{
var converter = TypeDescriptor.GetConverter(parameterDescriptors[i].ParameterType);
executeParameters[i] = converter.ConvertFrom(message.Value);
if (converter.IsValid(message.Value))
{
executeParameters[i] = converter.ConvertFrom(message.Value);
}
else
{
executeParameters[i] = message.Value;
}
}
}
}


Loading…
Cancel
Save