File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ module Stack.PackageDump
2525 ) where
2626
2727import Control.Applicative
28+ import Control.Exception.Enclosed (tryIO )
2829import Control.Monad (when , liftM )
2930import Control.Monad.Catch
3031import Control.Monad.IO.Class
@@ -189,11 +190,12 @@ addProfiling (InstalledCache ref) =
189190 Nothing -> do
190191 let loop [] = return False
191192 loop (dir: dirs) = do
192- contents <- getDirectoryContents $ S8. unpack dir
193+ econtents <- tryIO $ getDirectoryContents $ S8. unpack dir
194+ let contents = either (const [] ) id econtents
193195 if or [isProfiling content lib
194196 | content <- contents
195197 , lib <- dpLibraries dp
196- ]
198+ ] && not ( null contents)
197199 then return True
198200 else loop dirs
199201 loop $ dpLibDirs dp
You can’t perform that action at this time.
0 commit comments