daniellmb / markdownsharp

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

Null string will throw NullReference exception in Transform(). #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A null  string will throw a NullReference in Transform(). Attached patch will 
perform a null comparison check to the beginning of this method, eliminating 
this issue.

I'm not sure how a empty string will behave, or the intended behaviour with a  
passed empty string.

Original issue reported on code.google.com by alastair...@gmail.com on 29 Dec 2009 at 2:14

Attachments:

GoogleCodeExporter commented 9 years ago
I think a null string should be transformed in to an empty string.  Something 
like 
this:

if (text == null) return String.Empty;

Original comment by nberardi on 29 Dec 2009 at 3:19

GoogleCodeExporter commented 9 years ago
good idea -- also, I agree with Nick, let's just return "" if a null is found

Original comment by wump...@gmail.com on 30 Dec 2009 at 1:43