@@ -, +, @@ --- virtualshelves/sendshelf.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) --- a/virtualshelves/sendshelf.pl +++ a/virtualshelves/sendshelf.pl @@ -66,7 +66,15 @@ if ($to_address) { ); my $shelf = Koha::Virtualshelves->find( $shelfid ); - my $contents = $shelf->get_contents; + my $contents; + if( $shelf && $shelf->can_be_viewed($borrowernumber) ) { + $contents = $shelf->get_contents; + } else { + $template->param( error => 1, email => $to_address ); + output_html_with_http_headers $query, $cookie, $template->output; + exit; + } + my $marcflavour = C4::Context->preference('marcflavour'); my $iso2709; my @results; --