Commit f1cbf51

mo khan <mo.khan@gmail.com>
2020-05-17 23:10:05
Check if file exists
1 parent fbff31e
Changed files (1)
lib
spandx
lib/spandx/core/parser.rb
@@ -21,7 +21,7 @@ module Spandx
         include Registerable
 
         def for(path)
-          return UNKNOWN if File.size(path).zero?
+          return UNKNOWN if !File.exist?(path) || File.size(path).zero?
 
           find { |x| x.matches?(File.basename(path)) } || UNKNOWN
         end