Skip to content

Commit

Permalink
Adds check for dependency info while parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
sachin-sandhu committed Jan 23, 2025
1 parent ef43b4c commit 4fd1285
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions npm_and_yarn/lib/dependabot/npm_and_yarn/file_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,11 @@ def path_dependency_details_from_manifest(file)

resolution_deps = resolution_objects.flat_map(&:to_a)
.map do |path, value|
# skip dependencies that contain invalid values such as inline comments, null, etc.
# These values are usually in form of string arrays, so we can skip these deps.

next unless value.is_a?(String)

convert_dependency_path_to_name(path, value)
end

Expand Down

0 comments on commit 4fd1285

Please sign in to comment.