Skip to content
This repository was archived by the owner on Jan 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2133 from phoenixx/master
Browse files Browse the repository at this point in the history
Fixes issue #2131 with XmlProcessor
  • Loading branch information
khellang committed Nov 24, 2015
2 parents 1da115e + c355b01 commit c91283c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Nancy/Responses/Negotiation/XmlProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ private static Response CreateResponse(dynamic model, ISerializer serializer)
{
return new Response
{
Contents = stream => serializer.Serialize("application/xml", model, stream),
Contents = stream =>
{
if (model != null)
{
serializer.Serialize("application/xml", model, stream);
}
},
ContentType = "application/xml",
StatusCode = HttpStatusCode.OK
};
Expand Down

0 comments on commit c91283c

Please sign in to comment.