Skip to content

Commit

Permalink
Fix nil bug when there's no dependency key in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
koddsson authored Jan 17, 2025
1 parent 27353cc commit 7d9203f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/licensed/sources/npm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def enumerate_dependencies
end

def packages
root_dependencies = package_metadata["dependencies"]
root_dependencies = package_metadata["dependencies"] || {}
recursive_dependencies(root_dependencies).each_with_object({}) do |(name, results), hsh|
results.uniq! { |package| package["version"] }
if results.size == 1
Expand Down

0 comments on commit 7d9203f

Please sign in to comment.