make sure env exists before tryint to access it to fix CAR regression
John Napiorkowski [Thu, 7 Nov 2013 17:02:38 +0000 (11:02 -0600)]
lib/Catalyst/Request.pm

index 69ddd69..9f0e4ec 100644 (file)
@@ -243,7 +243,7 @@ sub prepare_body {
     # If previously applied middleware created the HTTP::Body object, then we
     # just use that one.  
 
-    if(my $plack_body = $self->env->{'plack.request.http.body'}) {
+    if(my $plack_body = $self->_has_env ? $self->env->{'plack.request.http.body'} : undef) {
         $self->_body($plack_body);
         $self->_body->cleanup(1);
         return;