netserver/hedgewars-server.hs
changeset 1394 962001cfcf48
parent 1393 6d04732abed2
child 1396 abb28dcb6d0d
--- a/netserver/hedgewars-server.hs	Tue Oct 21 18:29:21 2008 +0000
+++ b/netserver/hedgewars-server.hs	Tue Oct 21 18:31:40 2008 +0000
@@ -47,12 +47,12 @@
 	unless (null recipients) $ putStrLn ("< " ++ (show answer))
 
 	clHandles' <- forM recipients $
-		\ch -> Control.Exception.handle (\e -> putStrLn ("handle exception: " ++ show e) >> return []) $ -- cannot just remove
+		\ch -> Control.Exception.handle (\e -> putStrLn ("handle exception: " ++ show e) >> if head answer == "BYE" then return [ch] else return []) $ -- cannot just remove
 			do
 			forM_ answer (\str -> hPutStrLn ch str)
 			hPutStrLn ch ""
 			hFlush ch
-			if (not $ null answer) && (head answer == "BYE") then hClose ch >> return [ch] else return []
+			if head answer == "BYE" then hClose ch >> return [ch] else return []
 
 	let mclients = remove clients $ concat clHandles'