diff options
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/WebApp.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Utility/WebApp.hs b/Utility/WebApp.hs index 971422e36..be186baa2 100644 --- a/Utility/WebApp.hs +++ b/Utility/WebApp.hs @@ -67,7 +67,9 @@ runWebApp app observer = do localSocket :: IO Socket localSocket = do addrs <- getAddrInfo (Just hints) (Just localhost) Nothing - go $ Prelude.head addrs + case addrs of + [] -> error "unable to bind to a local socket" + (addr:_) -> go addr where hints = defaultHints { addrFlags = [AI_ADDRCONFIG] |