From a4e0413bf9a15246db0208b7dd685e330046e367 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 20 Feb 2019 02:11:19 +0100 Subject: [PATCH] Let `GitHub::open_api` return `nil` when status is `204 No Content`. --- Library/Homebrew/utils/github.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index 778eb5bcae..c733e5762a 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -209,6 +209,9 @@ module GitHub if !http_code.start_with?("2") || !status.success? raise_api_error(output, errors, http_code, headers, scopes) end + + return if http_code == "204" # No Content + json = JSON.parse output if block_given? yield json