diff --git a/Library/Homebrew/cask/artifact/relocated.rb b/Library/Homebrew/cask/artifact/relocated.rb index c6618c6d00..536b26be6e 100644 --- a/Library/Homebrew/cask/artifact/relocated.rb +++ b/Library/Homebrew/cask/artifact/relocated.rb @@ -52,7 +52,7 @@ module Cask @source_string = source.to_s @target_string = target.to_s base_path = cask.staged_path - base_path = base_path.join(cask.url.only_path) if cask.url && cask.url.only_path.present? + base_path = base_path.join(cask.url.only_path) if cask.url&.only_path.present? source = base_path.join(source) @source = source target ||= source.basename