Configuration patches to handle component based configuration in a sane way, as well...
[catagits/Catalyst-Action-Serialize-Data-Serializer.git] / lib / Catalyst / Action / Serialize / XML / Simple.pm
index de297d2..668e3f5 100644 (file)
@@ -25,7 +25,11 @@ sub execute {
     }
     my $xs = XML::Simple->new(ForceArray => 0,);
 
-    my $stash_key = $controller->config->{'serialize'}->{'stash_key'} || 'rest';
+    my $stash_key = (
+            $controller->config->{'serialize'} ?
+                $controller->config->{'serialize'}->{'stash_key'} :
+                $controller->config->{'stash_key'} 
+        ) || 'rest';
     my $output;
     eval {
         $output = $xs->XMLout({ data => $c->stash->{$stash_key} });