From 04203953ded802da4e761c9e8d38d3dbd2c11d0d Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Wed, 22 Jun 2022 09:47:59 -0400 Subject: [PATCH] Cask: Ensure #discontinued? returns a boolean The `Cask::DSL#discontinued?` method is expected to return a boolean value (`true`/`false`) but it will return `nil` for any casks without a `caveats` block. `nil` is still falsy but this commit ensures that the method will properly return a boolean value in this scenario. --- Library/Homebrew/cask/dsl.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cask/dsl.rb b/Library/Homebrew/cask/dsl.rb index d7648987a0..e56bfc9a18 100644 --- a/Library/Homebrew/cask/dsl.rb +++ b/Library/Homebrew/cask/dsl.rb @@ -281,7 +281,7 @@ module Cask end def discontinued? - @caveats&.discontinued? + @caveats&.discontinued? == true end # @api public