diff --git a/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb index 94e906a73e..d299733d89 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/abstract_uninstall.rb @@ -222,7 +222,7 @@ module Hbc paths.each do |path| resolved_path = Pathname.new(path) - resolved_path = resolved_path.expand_path if path.start_with?("~") + resolved_path = resolved_path.expand_path if path.to_s.start_with?("~") if resolved_path.relative? || resolved_path.split.any? { |part| part.to_s == ".." } opoo "Skipping #{Formatter.identifier(action)} for relative path '#{path}'."