Safe access to tap attributes

Prevent calling name tap attribute when the tap is nil

Co-Authored-By: Rylan Polster <rslpolster@gmail.com>
This commit is contained in:
Carlos Álvaro
2021-02-08 13:20:41 +01:00
co-authored by Rylan Polster
parent 7ca79553f0
commit aebf4c9100
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -169,8 +169,8 @@ module Cask
def to_h
{
"token" => token,
"full_token" => "#{tap.name}/#{token}",
"tap" => tap.name,
"full_token" => full_name,
"tap" => tap&.name,
"name" => name,
"desc" => desc,
"homepage" => homepage,
+1 -1
View File
@@ -1766,7 +1766,7 @@ class Formula
hsh = {
"name" => name,
"full_name" => full_name,
"tap" => tap.name,
"tap" => tap&.name,
"oldname" => oldname,
"aliases" => aliases.sort,
"versioned_formulae" => versioned_formulae.map(&:name),