diff --git a/Upgrade/V1.hs b/Upgrade/V1.hs index 270de5f74b..43f279ad08 100644 --- a/Upgrade/V1.hs +++ b/Upgrade/V1.hs @@ -115,8 +115,12 @@ moveLocationLogs = do oldlocationlogs = do g <- Annex.gitRepo let dir = gitStateDir g - contents <- liftIO $ getDirectoryContents dir - return $ catMaybes $ map oldlog2key contents + exists <- liftIO $ doesDirectoryExist dir + if exists + then do + contents <- liftIO $ getDirectoryContents dir + return $ catMaybes $ map oldlog2key contents + else return [] move (l, k) = do g <- Annex.gitRepo let dest = logFile g k