bumblebeeC / subtext

Automatically exported from code.google.com/p/subtext
0 stars 0 forks source link

Comment control fails to check for null feedback item body #306

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Added a code review comment to latest trunk:
http://code.google.com/p/subtext/source/detail?r=4236

In Subtext.Web/UI/Controls/Comments.cs, line 190, there is an if statement:

if(feedbackItem.Body.Length > 0)

The problem is, especially in older blogs that have upgraded several times, 
Body may be null. This if statement should be

if(!String.IsNullOrEmpty(feedbackItem.Body))

In production, this causes a NullReferenceException that gets pushed to the 
error log and comments for entries that have this issue end up not getting 
displayed.

Original issue reported on code.google.com by travis.illig on 2 Aug 2011 at 7:16