Skip to content

Commit c94ca09

Browse files
authored
Merge pull request metacpan#774 from metacpan/mickey/fix_stash_or_detach_exception
stash_or_detach: don't stash unless data is a hashref (throws an exce…
2 parents b3a4a45 + 54c62cf commit c94ca09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/MetaCPAN/Server.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use CatalystX::RoleApplicator;
1010
use File::Temp qw( tempdir );
1111
use Plack::Middleware::ReverseProxy;
1212
use Plack::Middleware::ServerStatus::Lite;
13-
use Ref::Util qw( is_arrayref );
13+
use Ref::Util qw( is_arrayref is_hashref );
1414
use Plack::Builder;
1515

1616
extends 'Catalyst';
@@ -156,7 +156,7 @@ sub read_param {
156156
# with a not_found message
157157
sub stash_or_detach {
158158
my ( $c, $data ) = @_;
159-
$data
159+
$data and is_hashref($data)
160160
? $c->stash($data)
161161
: $c->detach( '/not_found',
162162
['The requested info could not be found'] );

0 commit comments

Comments
 (0)