Explorar el Código

Croak 404 if necessary in Profile.pm

Daniel Gempesaw hace 11 años
padre
commit
a30d435a1a
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  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);
 }