I have the following code in a Razor Helper file
@helper MakeNoteBlank(string content)
{
string msg = "";
if(content == null)
{
msg = " ";
}
else
{
msg = content;
}
<div class="note">
<p>
@Html.Raw(msg)
</p>
</div>
}
The code fails at execution with the @Html.Raw(..) statement, stating that "Object reference not set to an instance of an object."
If I remove the @Html.Raw(..) and output 'msg' directly then there is no problem.
What am I doing wrong?