diff options
author | Joey Hess <joey@kitenet.net> | 2011-01-11 18:49:32 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-01-11 18:49:32 -0400 |
commit | 730c273eae055eaed743593b6ab7274e210bf4e3 (patch) | |
tree | 5df3509bfbe4dacca5634dc7325aa6087ccf4cc6 | |
parent | 8d6da87eec87de5317185f7bb8ebf50013e41c11 (diff) |
robustness fixes for empty or missing trust log
-rw-r--r-- | UUID.hs | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -145,8 +145,12 @@ getTrusted :: Annex [UUID] getTrusted = do logfile <- trustLog s <- liftIO $ catch (readFile logfile) ignoreerror - return $ map (\l -> head $ words l) $ lines s + return $ parse s where + parse [] = [] + parse s = map firstword $ lines s + firstword [] = "" + firstword l = head $ words l ignoreerror _ = return "" {- Changes the list of trusted UUIDs. -} |