checking for null or empty param before set
adding a simple test case
changing lucas' suggestions
Merge pull request #631 from caelum/nullHeaderParams

fixing problem with null headers