summaryrefslogtreecommitdiff
path: root/src/Propellor/Message.hs
diff options
context:
space:
mode:
authorJoey Hess2015-12-08 12:11:27 -0400
committerJoey Hess2015-12-08 12:11:27 -0400
commitcfe29b861122485304a9e18317524cc6a2c4101d (patch)
treec5ba065a36036856c4c4b1980f2d93e1757fe7f6 /src/Propellor/Message.hs
parent39c0073d2800e23b051188de239efdea9b17793e (diff)
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.
Diffstat (limited to 'src/Propellor/Message.hs')
-rw-r--r--src/Propellor/Message.hs2
1 files changed, 1 insertions, 1 deletions
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