diff options
| author | mo khan <mo@mokhan.ca> | 2021-05-10 21:26:36 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2021-05-10 21:26:36 -0600 |
| commit | 22aaf836c25c47f5f8b6bfa3120c9336406dd57f (patch) | |
| tree | 4ff480a35e83436fca6ef9efb8ea9b643d0eb150 /lib | |
| parent | b3060b8d30b93d0e7e420f60c3a3460c4318fe89 (diff) | |
fix: check for nil
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/spandx/core/dependency.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/spandx/core/dependency.rb b/lib/spandx/core/dependency.rb index ef169a1..3283f0a 100644 --- a/lib/spandx/core/dependency.rb +++ b/lib/spandx/core/dependency.rb @@ -33,8 +33,8 @@ module Spandx return 1 if other.nil? score = (name <=> other.name) - score = score.zero? ? (version <=> other&.version) : score - score.zero? ? (path.to_s <=> other&.path.to_s) : score + score = score&.zero? ? (version <=> other&.version) : score + score&.zero? ? (path.to_s <=> other&.path.to_s) : score end def hash |
