Merge pull request #19095 from Homebrew/bundle_version_plist_readable

cask/cask: ensure plist is readable before reading.
This commit is contained in:
Mike McQuaid 2025-01-14 09:13:47 +00:00 committed by GitHub
commit 011e9489d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -515,7 +515,7 @@ module Cask
sig { returns(T.nilable(Homebrew::BundleVersion)) }
def bundle_version
@bundle_version ||= if (bundle = artifacts.find { |a| a.is_a?(Artifact::App) }&.target) &&
(plist = Pathname("#{bundle}/Contents/Info.plist")) && plist.exist?
(plist = Pathname("#{bundle}/Contents/Info.plist")) && plist.exist? && plist.readable?
Homebrew::BundleVersion.from_info_plist(plist)
end
end