Fix crash in elasticsearch_check.rb (#21006)

Nil unwrap causes the admin dashboard to crash/500 when the Chewy client info version number value is nil.
This occurs when running another ES-compatible backend such as MeiliSearch.
Obviously it would be good for chewy to recognise upstream but at least avoiding the crash would be fine.
lolsob-rspec
s0 2022-12-16 01:56:48 +11:00 committed by GitHub
parent c7d4d21d99
commit 289097866b
1 changed files with 1 additions and 0 deletions

View File

@ -34,6 +34,7 @@ class Admin::SystemCheck::ElasticsearchCheck < Admin::SystemCheck::BaseCheck
end end
def compatible_version? def compatible_version?
return false if running_version.nil?
Gem::Version.new(running_version) >= Gem::Version.new(required_version) Gem::Version.new(running_version) >= Gem::Version.new(required_version)
end end
end end