Fix undef warning in Engine::FastCGI
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / FastCGI.pm
index 67b79be..30bb3a5 100644 (file)
@@ -159,6 +159,10 @@ sub run {
 sub write {
     my ( $self, $c, $buffer ) = @_;
 
+    # ->write will be called once with the body, even in a redirect (and
+    # in that case, the body is undef)
+    $buffer = '' if !defined $buffer;
+
     unless ( $self->_prepared_write ) {
         $self->prepare_write($c);
         $self->_prepared_write(1);