Why String.Trim()
throws an exception on string.empty
when it is used in a Razor view like this:
console.log('@Model.Test.FirstOrDefault().Trim()');
(the list is empty so i get string.empty
) and then:
Server Error in '/' Application.
Object reference not set to an instance of an object.
(...)'
Line 326: console.log('@Model.Test.FirstOrDefault().Trim()');