1
1
mirror of https://github.com/Yvee1/hascard.git synced 2024-11-22 12:51:58 +03:00

FIx crash on empty recents list

This commit is contained in:
Steven van den Broek 2020-08-20 22:48:11 +02:00
parent 43e5c5fd50
commit 62046234ab

View File

@ -69,6 +69,7 @@ initLast (x:xs) = let (xs', y) = initLast xs
in (x:xs', y)
prep :: [FilePath] -> ([String], [FilePath])
prep [] = ([], [])
prep fps@(fp:_) = if all ((== takeExtension fp) . takeExtension) fps
then unzip (map ((\(pre, fn) -> (pre, dropExtension fn)) . splitFileName) fps)
else unzip (map splitFileName fps)