diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-12-08 12:11:27 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-12-08 12:11:27 -0400 |
| commit | cfe29b861122485304a9e18317524cc6a2c4101d (patch) | |
| tree | c5ba065a36036856c4c4b1980f2d93e1757fe7f6 | |
| parent | 39c0073d2800e23b051188de239efdea9b17793e (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.
| -rw-r--r-- | src/Propellor/Message.hs | 2 |
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 |
