From f88738223ee5156baac8f0fa0bde6d701f1fdd07 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 30 Sep 2011 14:59:35 -0400 Subject: [PATCH] don't crash on malformed lines in uuid.log --- UUID.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/UUID.hs b/UUID.hs index a150dc333c..b1ccbb250c 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