diff --git a/src/Nancy/Responses/Negotiation/XmlProcessor.cs b/src/Nancy/Responses/Negotiation/XmlProcessor.cs index 353cb6999f..b2d3f19173 100644 --- a/src/Nancy/Responses/Negotiation/XmlProcessor.cs +++ b/src/Nancy/Responses/Negotiation/XmlProcessor.cs @@ -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 };