aboutsummaryrefslogtreecommitdiff
path: root/Trust.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Trust.hs')
-rw-r--r--Trust.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/Trust.hs b/Trust.hs
index 9474d47d7..695059a93 100644
--- a/Trust.hs
+++ b/Trust.hs
@@ -73,6 +73,8 @@ trustMapParse s = M.fromList $ map pair $ filter (not . null) $ lines s
{- Changes the trust level for a uuid in the trustLog, and commits it. -}
trustSet :: UUID -> TrustLevel -> Annex ()
trustSet uuid level = do
+ when (null uuid) $
+ error "unknown UUID; cannot modify trust level"
m <- trustMap
when (M.lookup uuid m /= Just level) $ do
let m' = M.insert uuid level m