diff options
| author | mo khan <mo.khan@gmail.com> | 2020-05-17 17:10:05 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-05-17 17:10:05 -0600 |
| commit | f1cbf51f1a185d70c45959c3e2199b29ccbacd1d (patch) | |
| tree | 2322da54fb505427915c65f296eb1a88afdd533b /lib | |
| parent | fbff31e55933fd6296ade7d9d9d50fd6135bdee2 (diff) | |
Check if file exists
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/spandx/core/parser.rb | 2 |
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 |
