Skip to content

Commit 1037447

Browse files
committed
Don't use fromJust, prefer empty name of internal library instead
1 parent f4d9fac commit 1037447

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Stack/Package.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module Stack.Package
4242
import qualified Data.ByteString as BS
4343
import qualified Data.ByteString.Char8 as C8
4444
import Data.List (isSuffixOf, isPrefixOf)
45-
import Data.Maybe (fromJust)
45+
import Data.Maybe (maybe)
4646
import qualified Data.Map.Strict as M
4747
import qualified Data.Set as S
4848
import qualified Data.Text as T
@@ -736,7 +736,7 @@ packageDescModulesAndFiles pkg = do
736736
return (modules, files, dfiles, warnings)
737737
where
738738
libComponent = const CLib
739-
internalLibComponent = CInternalLib . T.pack . Cabal.unUnqualComponentName . fromJust . libName
739+
internalLibComponent = CInternalLib . T.pack . maybe "" Cabal.unUnqualComponentName . libName
740740
exeComponent = CExe . T.pack . Cabal.unUnqualComponentName . exeName
741741
testComponent = CTest . T.pack . Cabal.unUnqualComponentName . testName
742742
benchComponent = CBench . T.pack . Cabal.unUnqualComponentName . benchmarkName

0 commit comments

Comments
 (0)