[Mono-dev] System.NullReferenceException, what does it mean?

Wade Maxfield wmaxfield at gmail.com
Mon Apr 3 15:12:32 EDT 2006


Hi,

  The webResponse.ContentEncoding string is "", and Trim() doesn't do
anything.

  This makes the responseEncoding string comes back with "", and therefore
it sticks us-ascii into it.  Since we are totally inhouse on this one, I can
force that.  This was a few lines of example code from somewhere blended
into my current program.  I'm still learning.

  Mono throws an error saying that the object is null, as opposed to giving
it a value of  "".

wade

On 4/3/06, Chris Toshok <toshok at ximian.com> wrote:
>
> mono stack trace line numbers are generally 1 off.  So the line which is
> throwing the exception is actually:
>
> string responseEncoding = webResponse.ContentEncoding.Trim();
>
> This does in fact work in MS?  what's the value of
> webResponse.ContentEncoding?
>
> Chris
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060403/5eb4a2c3/attachment.html 


More information about the Mono-devel-list mailing list