summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-05-17 17:10:05 -0600
committermo khan <mo.khan@gmail.com>2020-05-17 17:10:05 -0600
commitf1cbf51f1a185d70c45959c3e2199b29ccbacd1d (patch)
tree2322da54fb505427915c65f296eb1a88afdd533b /lib
parentfbff31e55933fd6296ade7d9d9d50fd6135bdee2 (diff)
Check if file exists
Diffstat (limited to 'lib')
-rw-r--r--lib/spandx/core/parser.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/spandx/core/parser.rb b/lib/spandx/core/parser.rb
index bdd6f1b..00d0278 100644
--- a/lib/spandx/core/parser.rb
+++ b/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