summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-09-30 14:59:35 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-09-30 15:02:29 -0400
commitf88738223ee5156baac8f0fa0bde6d701f1fdd07 (patch)
tree5189044e7360e405aaef7a4efdf36322f40d12e0
parentd48ae1b8fd2d73746986bd40d22de450d647d223 (diff)
don't crash on malformed lines in uuid.log
-rw-r--r--UUID.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/UUID.hs b/UUID.hs
index a150dc333..b1ccbb250 100644
--- a/UUID.hs
+++ b/UUID.hs
@@ -100,4 +100,8 @@ uuidMap = do
s <- Branch.get uuidLog
return $ M.fromList $ map pair $ lines s
where
- pair l = (head $ words l, unwords $ drop 1 $ words l)
+ pair l
+ | null ws = ("", "")
+ | otherwise = (head ws, unwords $ drop 1 ws)
+ where
+ ws = words l