Skip to content

Commit

Permalink
Fix a couple error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
deven committed Feb 17, 2022
1 parent 5a411fc commit f3baf76
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/PDF/Data.pm
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ sub merge_content_streams {

# Remove extra trailing space from streams.
foreach my $stream (@{$streams}) {
croak unless is_stream $stream;
die unless is_stream $stream;
$stream->{-data} =~ s/(?<=\s) \z//;
}

Expand Down Expand Up @@ -698,7 +698,8 @@ sub parse_objects {
} elsif (s/\A(<<((?:[^<>]+|<[^<>]+>|(?1))*)$ws?>>)//) { # Dictionary: <<...>> (including nested dictionaries)
my @pairs = $self->parse_objects($objects, $2, $offset);
for (my $i = 0; $i < @pairs; $i++) {
$pairs[$i] = $i % 2 ? $pairs[$i][0] : $pairs[$i][1]{name} // croak;
$pairs[$i] = $i % 2 ? $pairs[$i][0] : $pairs[$i][1]{name}
// croak "Byte offset $offset: Dictionary key is not a name!\n";
}
push @objects, [ { @pairs }, { type => "dict" } ];
} elsif (s/\A(\[((?:(?>[^\[\]]+)|(?1))*)\])//) { # Array: [...] (including nested arrays)
Expand Down

0 comments on commit f3baf76

Please sign in to comment.