lib/ruby_indexer/lib/ruby_indexer/configuration.rb in ruby-lsp-0.12.1 vs lib/ruby_indexer/lib/ruby_indexer/configuration.rb in ruby-lsp-0.12.2
- old
+ new
@@ -196,10 +196,14 @@
others.concat(this_gem.to_spec.dependencies) if this_gem
excluded.each do |dependency|
next unless dependency.runtime?
- dependency.to_spec.dependencies.each do |transitive_dependency|
+ # If the dependency is prerelease, to_spec may return `nil`
+ spec = dependency.to_spec
+ next unless spec
+
+ spec.dependencies.each do |transitive_dependency|
# If the transitive dependency is included in other groups, skip it
next if others.any? { |d| d.name == transitive_dependency.name }
# If the transitive dependency is included as a transitive dependency of a gem outside of the development
# group, skip it