Skip to content

Commit

Permalink
fix when no valid constraints found
Browse files Browse the repository at this point in the history
  • Loading branch information
kbukum1 committed Jan 31, 2025
1 parent 54ad7bd commit a364d4a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions npm_and_yarn/lib/dependabot/npm_and_yarn/package_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,10 @@ def find_engine_constraints_as_requirement(name) # rubocop:disable Metrics/Perce

end

Dependabot.logger.info("Parsed constraints for #{name}: #{constraints.join(', ')}")
Requirement.new(constraints)
if constraints
Dependabot.logger.info("Parsed constraints for #{name}: #{constraints.join(', ')}")
Requirement.new(constraints)
end
rescue StandardError => e
Dependabot.logger.error("Error processing constraints for #{name}: #{e.message}")
nil
Expand Down

0 comments on commit a364d4a

Please sign in to comment.