From cfe29b861122485304a9e18317524cc6a2c4101d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Dec 2015 12:11:27 -0400 Subject: avoid crash when stdout is not open in call to hIsTerminalDevice Saw this happen in http://propellor.branchable.com/forum/Fail_to_push_changes_when_merging/ although I don't entirely understand the circumstances. --- src/Propellor/Message.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Propellor/Message.hs') diff --git a/src/Propellor/Message.hs b/src/Propellor/Message.hs index e964c664..576e58ee 100644 --- a/src/Propellor/Message.hs +++ b/src/Propellor/Message.hs @@ -41,7 +41,7 @@ data MessageHandle = MessageHandle globalMessageHandle :: MVar MessageHandle globalMessageHandle = unsafePerformIO $ newMVar =<< MessageHandle - <$> hIsTerminalDevice stdout + <$> catchDefaultIO False (hIsTerminalDevice stdout) -- | Gets the global MessageHandle. getMessageHandle :: IO MessageHandle -- cgit v1.2.3