From e2e35def359c5c462ca8447ea9b900e0c49d3019 Mon Sep 17 00:00:00 2001 From: Martin Afanasjew Date: Fri, 24 Jun 2016 06:40:52 +0200 Subject: [PATCH] bottle: avoid raising exception in ensure block The `ensure` block can be reached before the tab is modified (and thus before `original_tab` gets populated). Avoid raising an exception when attempting to restore a tab that hasn't been modified yet, e.g. because relocating some of the Mach-O binaries failed. --- Library/Homebrew/cmd/bottle.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb index 36c71f75a8..8581d0a95c 100644 --- a/Library/Homebrew/cmd/bottle.rb +++ b/Library/Homebrew/cmd/bottle.rb @@ -255,7 +255,7 @@ module Homebrew raise ensure ignore_interrupts do - original_tab.write + original_tab.write if original_tab keg.relocate_install_names Keg::PREFIX_PLACEHOLDER, prefix, Keg::CELLAR_PLACEHOLDER, cellar keg.relocate_text_files Keg::PREFIX_PLACEHOLDER, prefix,