From 278bc77f2d7e33d3541e8ff79687d3585b33ec65 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Tue, 24 Nov 2020 10:47:25 +0100 Subject: [PATCH] fix: launchctl list can return empty id causing Error: undefined method `match?' for nil:NilClass Seen in macOS Big Sur --- Library/Homebrew/cask/artifact/abstract_uninstall.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index 51505e70c9..c669999d15 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -127,7 +127,7 @@ module Cask .map { |line| line.chomp.split("\t") } .map { |pid, state, id| [pid.to_i, state.to_i, id] } .select do |(pid, _, id)| - pid.nonzero? && id.match?(/^#{Regexp.escape(bundle_id)}($|\.\d+)/) + pid.nonzero? && /^#{Regexp.escape(bundle_id)}($|\.\d+)/.match?(id) end end