Skip to content

Commit 14862a9

Browse files
authored
Handle #to_spec #=> nil in RubyIndexer::Configuration (#1242)
Handle `#to_spec #=> nil` If the dependency is a prerelease, `to_spec` may return `nil`. This would crash ruby-lsp on boot.
1 parent a1977a7 commit 14862a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ruby_indexer/lib/ruby_indexer/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def initial_excluded_gems
193193
# When working on a gem, we need to make sure that its gemspec dependencies can't be excluded. This is necessary
194194
# because Bundler doesn't assign groups to gemspec dependencies
195195
this_gem = Bundler.definition.dependencies.find do |d|
196-
d.to_spec.full_gem_path == Dir.pwd
196+
d.to_spec&.full_gem_path == Dir.pwd
197197
rescue Gem::MissingSpecError
198198
false
199199
end

0 commit comments

Comments
 (0)