#179 NullPointerException if fieldvalue not set


I´m using HTTPUnit 1.7 to test a file upload.
I got an NullPointerException from MimeEncodedMessageBody.fixLineEndings( String value ).
because i did not explicitly set an empty value for each Teaxtarea on my form.
So if it comes to the mentioned method, the value is null and Java tells me about the NullPointerException.
I needed a debug Session to find out that i have to set the values explicitly. I didn´t read all Howto´s and References.
So maybe i should have known if i RTFM. But wouldn´t it be smarter if you check for a value which is null at this place and either replace it by an empty String or throw an Exception with a better Failure Message ?


  • Wolfgang Fahl

    Wolfgang Fahl - 2008-11-15

    Dear httpunit user!

    Thank you for your feature request. We appreciate the time and effort you are putting into this.

    Please supply a testcase with the expected result for the feature you are asking for and we'll look into implementing it. For a start you might want to get the trunk version from the
    subversion repository (see https://sourceforge.net/svn/?group_id=6550\)
    and have a look at the source code of some of the more than 700 JUnit based testcase in there.

    When you are ready you might want to attach the testcase (and if you already have started implementing it also the actual code) to your feature request.

    This should give you a clue on what a proper testcase for httpunit looks like. The main communication about further details of the development is via the httpunit developer mailinglist. You are most welcome to sign up via

    The httpunit developer team

    (Russell and Wolfgang as of 2008-03)

  • Wolfgang Fahl

    Wolfgang Fahl - 2008-11-15
    • assigned_to: nobody --> wolfgang_fahl
  • Wolfgang Fahl

    Wolfgang Fahl - 2008-11-15

    Dear Fabian,

    thanks for your Bug Report. Could you please supply a JUnit testcase along the line of the existing ones and I'll happily fix this.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks