Fix a bug (check parameters)
authorunc0rr
Fri, 31 Oct 2008 14:35:59 +0000
changeset 1442 ef9785d0b392
parent 1441 d2a6b02b697b
child 1443 e79e4b48c771
Fix a bug (check parameters)
netserver/HWProto.hs
--- a/netserver/HWProto.hs	Fri Oct 31 14:30:08 2008 +0000
+++ b/netserver/HWProto.hs	Fri Oct 31 14:35:59 2008 +0000
@@ -219,7 +219,10 @@
 	if not $ isMaster client then
 		(noChangeClients, noChangeRooms, answerNotMaster)
 	else
-		(noChangeClients, modifyRoom $ modifyTeam clRoom team{teamcolor = newColor}, answerTeamColor teamName newColor)
+		if noSuchTeam then
+			(noChangeClients, noChangeRooms, answerBadParam)
+		else
+			(noChangeClients, modifyRoom $ modifyTeam clRoom team{teamcolor = newColor}, answerTeamColor teamName newColor)
 	where
 		noSuchTeam = isNothing findTeam
 		team = fromJust findTeam