Configuration patches to handle component based configuration in a sane way, as well...
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / Serialize / View.pm
index 93be123..09ee45b 100644 (file)
@@ -7,8 +7,12 @@ use base 'Catalyst::Action';
 sub execute {
     my $self = shift;
     my ( $controller, $c, $view ) = @_;
-    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';
 
     if ( !$c->view($view) ) {
         $c->log->error("Could not load $view, refusing to serialize");