Fix exception message and add test cases.

This commit is contained in:
PMExtra
2020-04-03 15:03:10 +08:00
parent c83bec6e81
commit 774d49a908
2 changed files with 5 additions and 1 deletions
@@ -25,7 +25,7 @@ namespace MQTTnet.Extensions
}
catch (Exception ex)
{
throw new InvalidOperationException($"Cannot convert value({value}) of UserProperty({propertyName}) to {typeof(T).FullName}.", ex);
throw new InvalidOperationException($"Cannot convert value({value ?? "null"}) of UserProperty({propertyName}) to {typeof(T).FullName}.", ex);
}
}
}