Skip to content

Commit 84704dc

Browse files
Throw value to see what's going on on Linux
1 parent bf3ab9d commit 84704dc

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/ImageSharp.Web/Commands/Converters/ColorConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public object ConvertFrom(CommandParser parser, CultureInfo culture, string valu
4444
// Numeric r,g,b - r,g,b,a
4545
char separator = culture.TextInfo.ListSeparator[0];
4646

47-
if (value.Contains(separator.ToString()))
47+
if (value.IndexOf(separator) != -1)
4848
{
4949
string[] components = value.Split(separator);
5050

src/ImageSharp.Web/Commands/Converters/SimpleCommandConverter{T}.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,19 @@ public object ConvertFrom(
3131
Type t = typeof(T);
3232
Type u = Nullable.GetUnderlyingType(t);
3333

34-
if (u != null)
34+
try
3535
{
36-
return (T)Convert.ChangeType(value, u, culture);
37-
}
36+
if (u != null)
37+
{
38+
return (T)Convert.ChangeType(value, u, culture);
39+
}
3840

39-
return (T)Convert.ChangeType(value, t, culture);
41+
return (T)Convert.ChangeType(value, t, culture);
42+
}
43+
catch (Exception)
44+
{
45+
throw new Exception(value);
46+
}
4047
}
4148
}
4249
}

0 commit comments

Comments
 (0)