fix crash in drop scan when there are no associated files

maximum is partial, so need to ensure the list is not empty.

This lack of associated files would most likely be a problem -- and fsck
fixes it. It could also occur legitimately due to a race.
This commit is contained in:
Joey Hess 2013-06-24 12:44:51 -04:00
parent c40021e736
commit ce9be5ec14

View file

@ -45,7 +45,11 @@ handleDropsFrom :: [UUID] -> [Remote] -> Reason -> Bool -> Key -> AssociatedFile
handleDropsFrom _ _ _ _ _ Nothing _ = noop
handleDropsFrom locs rs reason fromhere key (Just afile) knownpresentremote = do
fs <- liftAnnex $ ifM isDirect
( associatedFilesRelative key
( do
l <- associatedFilesRelative key
if null l
then return [afile]
else return l
, return [afile]
)
n <- getcopies fs