Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

(RT #79678) No need to redact arguments when there's none defined for…

… the line.
  • Loading branch information...
commit a4cc714fca5d22ecd6fe268da7c2541298b7b6c4 1 parent 0afefd3
@guillaumeaubert guillaumeaubert authored
Showing with 13 additions and 9 deletions.
  1. +13 −9 lib/Carp/Parse/CallerInformation/Redacted.pm
View
22 lib/Carp/Parse/CallerInformation/Redacted.pm
@@ -114,17 +114,21 @@ sub get_redacted_line
my ( $self ) = @_;
my $line = $self->get_line();
- my $redacted_arguments_list = $self->get_redacted_arguments_list() || [];
my $arguments_string = $self->get_arguments_string();
- # Data::Dump::dump() is really nice except that it treats arrays with
- # only one member as a string, so we need to make an exception for
- # formatting in that case.
- my $redacted_arguments_string = Data::Dump::dump( @$redacted_arguments_list );
- $redacted_arguments_string = "($redacted_arguments_string)"
- if scalar( @$redacted_arguments_list ) == 1;
-
- $line =~ s/\(\Q$arguments_string\E\)/$redacted_arguments_string/x;
+ if ( defined( $arguments_string ) )
+ {
+ my $redacted_arguments_list = $self->get_redacted_arguments_list() || [];
+
+ # Data::Dump::dump() is really nice except that it treats arrays with
+ # only one member as a string, so we need to make an exception for
+ # formatting in that case.
+ my $redacted_arguments_string = Data::Dump::dump( @$redacted_arguments_list );
+ $redacted_arguments_string = "($redacted_arguments_string)"
+ if scalar( @$redacted_arguments_list ) == 1;
+
+ $line =~ s/\(\Q$arguments_string\E\)/$redacted_arguments_string/x;
+ }
return $line
}
Please sign in to comment.
Something went wrong with that request. Please try again.