فهرست منبع

Fix manual binary validation in FindBinary

Apparently, abs_path throws on Windows but returns a path to a
non-existent file on UNIX. Since I was depending catching the die from
abs_path, we'll just die on our own and handle it that way.
Daniel Gempesaw 10 سال پیش
والد
کامیت
42eba2a0e9
1فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 6 1
      lib/Selenium/CanStartBinary/FindBinary.pm

+ 6 - 1
lib/Selenium/CanStartBinary/FindBinary.pm

@@ -38,7 +38,12 @@ sub coerce_firefox_binary {
 sub _validate_manual_binary {
     my ($executable) = @_;
 
-    my $abs_executable = eval { abs_path($executable) };
+    my $abs_executable = eval {
+        my $path = abs_path($executable);
+        die unless -e $path;
+        $path
+    };
+
     if ( $abs_executable ) {
         if ( -x $abs_executable ) {
             return $abs_executable;