Browse Source

Croak 404 if necessary in Profile.pm

Daniel Gempesaw 11 years ago
parent
commit
a30d435a1a
1 changed files with 2 additions and 1 deletions
  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);
 }