Skip to content

Commit 16c1913

Browse files
committed
stack-trace if transform gets undef $inds
1 parent 5f7d198 commit 16c1913

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/PDL/Graphics/TriD/Graph.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ sub finish_scale {
187187
# Add 0..1 to each axis.
188188
sub transform {
189189
my ($this,$point,$data,$inds) = @_;
190+
PDL::barf "no \$inds given" if !defined $inds;
190191
my ($min, $max) = map $this->{Scale}->slice("0:$#$inds,$_"), 0, 1;
191192
$point->slice("0:$#$inds") +=
192193
($data->dice_axis(0, $inds) - $min) / ($max - $min);
@@ -303,6 +304,7 @@ sub finish_scale {
303304

304305
sub transform {
305306
my ($this,$point,$data,$inds) = @_;
307+
PDL::barf "no \$inds given" if !defined $inds;
306308
barf "Wrong number of arguments to transform $this\n" if @$inds != 3;
307309
my $i = 0;
308310
my $pio180 = 0.017453292;
@@ -395,6 +397,7 @@ sub finish_scale {
395397

396398
sub transform {
397399
my ($this,$point,$data,$inds) = @_;
400+
PDL::barf "no \$inds given" if !defined $inds;
398401
my $i = 0;
399402
barf "Wrong number of arguments to transform $this\n" if @$inds != 3;
400403
my $pio180 = 0.017453292;

0 commit comments

Comments
 (0)