Skip to content

Commit

Permalink
Merge pull request #48 from NileshGhodekar/master
Browse files Browse the repository at this point in the history
ConvertToString function to accept Null parameter. Issue #47
  • Loading branch information
NileshGhodekar authored Oct 12, 2017
2 parents 38034a3 + 9c86d0f commit 3c49aee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal static class VersionInfo
/// Build Number (MMDD)
/// Revision (if any on the same day)
/// </summary>
internal const string Version = "2.17.0927.0";
internal const string Version = "2.17.1012.0";

/// <summary>
/// File Version information for the assembly consists of the following four values:
Expand All @@ -31,6 +31,6 @@ internal static class VersionInfo
/// Build Number (MMDD)
/// Revision (if any on the same day)
/// </summary>
internal const string FileVersion = "2.17.0927.0";
internal const string FileVersion = "2.17.1012.0";
}
}
7 changes: 2 additions & 5 deletions src/WorkflowActivityLibrary/Common/ExpressionFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4579,10 +4579,6 @@ private string ConvertToString()
Type parameterType3 = typeof(Guid);
Type parameterType4 = typeof(byte[]);
object parameter = this.parameters[0];
if (parameter == null)
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionConvertToStringNullFunctionParameterError, new InvalidFunctionFormatException(Messages.ExpressionFunction_NullFunctionParameterError, this.function, 1));
}

if (!this.VerifyType(parameter, parameterType) && !this.VerifyType(parameter, parameterType2) && !this.VerifyType(parameter, parameterType3) && !this.VerifyType(parameter, parameterType4) && !this.VerifyType(parameter, typeof(string)))
{
Expand All @@ -4593,7 +4589,8 @@ private string ConvertToString()

if (this.mode != EvaluationMode.Parse)
{
result = Convert.ToString(parameter, CultureInfo.InvariantCulture);
result = parameter == null ? null : Convert.ToString(parameter, CultureInfo.InvariantCulture);

Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionConvertToString, "ConvertToString('{0}') returned '{1}'.", this.parameters[0], result);
}
else
Expand Down

0 comments on commit 3c49aee

Please sign in to comment.