Parcourir la source

Croak 404 if necessary in Profile.pm

Daniel Gempesaw il y a 11 ans
Parent
commit
a30d435a1a
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      lib/Selenium/Remote/Driver/Firefox/Profile.pm

+ 2 - 1
lib/Selenium/Remote/Driver/Firefox/Profile.pm

@@ -162,8 +162,9 @@ directories.
 sub add_extension {
     my ($self, $xpi) = @_;
 
+    croak 'File not found: ' . $xpi unless -e $xpi;
     my $xpi_abs_path = abs_path($xpi);
-    croak "$xpi_abs_path: extensions must be in .xpi format" unless $xpi_abs_path =~ /\.xpi$/;
+    croak '$xpi_abs_path: extensions must be in .xpi format' unless $xpi_abs_path =~ /\.xpi$/;
 
     push (@{$self->{extensions}}, $xpi_abs_path);
 }