cmd/info: handle when tab tap is nil

This commit is contained in:
Ruoyu Zhong 2025-02-13 15:33:45 +08:00 committed by GitHub
parent 7aa1725aff
commit 59445c7961
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -298,7 +298,7 @@ module Homebrew
kegs = [
*heads.sort_by { |keg| -keg.tab.time.to_i },
*versioned.sort_by(&:scheme_and_version),
].select { |keg| keg.tab.tap == formula.tap }
].select { |keg| (tap = keg.tab.tap).nil? || tap == formula.tap }
if kegs.empty?
puts "Not installed"
if (bottle = formula.bottle)