Fixed issue in AngularValueResetPasswordCodeInfoScript

Signed-off-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
Bjarke Berg
2020-09-23 11:30:16 +02:00
parent 5045a580cc
commit 56820b164f

View File

@@ -112,8 +112,6 @@ namespace Umbraco.Extensions
/// <returns></returns>
public static IHtmlContent AngularValueResetPasswordCodeInfoScript(this IHtmlHelper html, object val)
{
if (val is null) return html.Raw(string.Empty);
var sb = new StringBuilder();
sb.AppendLine();
sb.AppendLine(@"var errors = [];");
@@ -129,7 +127,7 @@ namespace Umbraco.Extensions
sb.AppendLine(@"app.value(""resetPasswordCodeInfo"", {");
sb.AppendLine(@"errors: errors,");
sb.Append(@"resetCodeModel: ");
sb.AppendLine(val.ToString());
sb.AppendLine(val?.ToString() ?? "null");
sb.AppendLine(@"});");
return html.Raw(sb.ToString());