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:
parent
c40021e736
commit
ce9be5ec14
1 changed files with 5 additions and 1 deletions
|
@ -45,7 +45,11 @@ handleDropsFrom :: [UUID] -> [Remote] -> Reason -> Bool -> Key -> AssociatedFile
|
||||||
handleDropsFrom _ _ _ _ _ Nothing _ = noop
|
handleDropsFrom _ _ _ _ _ Nothing _ = noop
|
||||||
handleDropsFrom locs rs reason fromhere key (Just afile) knownpresentremote = do
|
handleDropsFrom locs rs reason fromhere key (Just afile) knownpresentremote = do
|
||||||
fs <- liftAnnex $ ifM isDirect
|
fs <- liftAnnex $ ifM isDirect
|
||||||
( associatedFilesRelative key
|
( do
|
||||||
|
l <- associatedFilesRelative key
|
||||||
|
if null l
|
||||||
|
then return [afile]
|
||||||
|
else return l
|
||||||
, return [afile]
|
, return [afile]
|
||||||
)
|
)
|
||||||
n <- getcopies fs
|
n <- getcopies fs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue