summaryrefslogtreecommitdiffhomepage
path: root/Storage/Local.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Storage/Local.hs')
-rw-r--r--Storage/Local.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Storage/Local.hs b/Storage/Local.hs
index 637a31b..c1dcea4 100644
--- a/Storage/Local.hs
+++ b/Storage/Local.hs
@@ -112,8 +112,11 @@ obscure section getsharedir = onError (ObscureFailure . show) $ do
count :: Section -> GetShareDir -> IO CountResult
count section getsharedir = onError (CountFailure . show) $ do
dir <- getsharedir section
- CountResult . genericLength . filter isShareFile
- <$> getDirectoryContents dir
+ exists <- doesDirectoryExist dir
+ if exists
+ then CountResult . genericLength . filter isShareFile
+ <$> getDirectoryContents dir
+ else return (CountResult 0)
move :: Section -> GetShareDir -> Storage -> IO [StoreResult]
move section getsharedir storage = do