X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Flib%2FTestApp%2FView%2FDump.pm;fp=t%2Flib%2FTestApp%2FView%2FDump.pm;h=a59e417ef90225e40818b8ab8bd69488f82ea2b0;hp=c4c29dbfa4d7ab62618df2389d4eb52214ecae9c;hb=c3fd63d4399bec38e1cd6ac94b4aed8ba61966b8;hpb=27042f8bac5a59e90bb3ab03040cad90b1c5a62c diff --git a/t/lib/TestApp/View/Dump.pm b/t/lib/TestApp/View/Dump.pm index c4c29db..a59e417 100644 --- a/t/lib/TestApp/View/Dump.pm +++ b/t/lib/TestApp/View/Dump.pm @@ -43,13 +43,17 @@ sub process { $c->res->headers->content_type('text/plain'); $c->res->output($output); - # Repair context - $reference->{_context} = $context; - weaken( $reference->{_context} ); - - # Repair body - delete $reference->{__body_type}; - $reference->{_body} = $body; + if ($context) { + # Repair context + $reference->{_context} = $context; + weaken( $reference->{_context} ); + } + + if ($body) { + # Repair body + delete $reference->{__body_type}; + $reference->{_body} = $body; + } return 1; }