Added ConvertToNullableDecimalTest and check that fixes the decimal save issue

This commit is contained in:
Robert
2018-02-08 16:21:09 +01:00
parent 6618388973
commit 4423571eaa
2 changed files with 42 additions and 1 deletions

View File

@@ -156,6 +156,11 @@ namespace Umbraco.Core
if (inner.Success)
{
input = inner.Result; // Now fall on through...
if (input is decimal)
{
target = underlying;
}
}
else
{
@@ -212,7 +217,7 @@ namespace Umbraco.Core
var convertible2 = input as IConvertible;
if (convertible2 != null)
{
return Attempt.Succeed(Convert.ChangeType(convertible2, Nullable.GetUnderlyingType(target) ?? target));
return Attempt.Succeed(Convert.ChangeType(convertible2, target));
}
}
catch (Exception e)