Configuration patches to handle component based configuration in a sane way, as well...
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / Serialize / YAML.pm
index 8a5939d..9ef8dc0 100644 (file)
@@ -17,7 +17,11 @@ sub execute {
     my $self = shift;
     my ( $controller, $c ) = @_;
 
-    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 = Dump($c->stash->{$stash_key});