[Catalyst-commits] r10457 - Catalyst-Runtime/5.80/trunk/t/lib/TestApp/View

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Sat Jun 6 12:20:38 GMT 2009


Author: t0m
Date: 2009-06-06 12:20:37 +0000 (Sat, 06 Jun 2009)
New Revision: 10457

Modified:
   Catalyst-Runtime/5.80/trunk/t/lib/TestApp/View/Dump.pm
Log:
Fix warnings, we may not always be dumping a  object

Modified: Catalyst-Runtime/5.80/trunk/t/lib/TestApp/View/Dump.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp/View/Dump.pm	2009-06-06 11:45:39 UTC (rev 10456)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp/View/Dump.pm	2009-06-06 12:20:37 UTC (rev 10457)
@@ -43,13 +43,17 @@
         $c->res->headers->content_type('text/plain');
         $c->res->output($output);
 
-        # Repair context
-        $reference->{_context} = $context;
-        weaken( $reference->{_context} );
+        if ($context) {
+            # Repair context
+            $reference->{_context} = $context;
+            weaken( $reference->{_context} );
+        }
 
-        # Repair body
-        delete $reference->{__body_type};
-        $reference->{_body} = $body;
+        if ($body) {
+            # Repair body
+            delete $reference->{__body_type};
+            $reference->{_body} = $body;
+        }
 
         return 1;
     }




More information about the Catalyst-commits mailing list