.BANCHO. .FIX. Fix None token in cantSpectateEvent
This commit is contained in:
		| @@ -5,16 +5,13 @@ from objects import glob | |||||||
|  |  | ||||||
|  |  | ||||||
| def handle(userToken, _): | def handle(userToken, _): | ||||||
| 	# get usertoken data |  | ||||||
| 	userID = userToken.userID |  | ||||||
|  |  | ||||||
| 	try: | 	try: | ||||||
| 		# We don't have the beatmap, we can't spectate | 		# We don't have the beatmap, we can't spectate | ||||||
| 		target = userToken.spectating | 		if userToken.spectating not in glob.tokens.tokens: | ||||||
| 		targetToken = glob.tokens.getTokenFromUserID(target) | 			raise exceptions.tokenNotFoundException | ||||||
|  |  | ||||||
| 		# Send the packet to host | 		# Send the packet to host | ||||||
| 		targetToken.enqueue(serverPackets.noSongSpectator(userID)) | 		glob.tokens.tokens[userToken.spectating].enqueue(serverPackets.noSongSpectator(userToken.userID)) | ||||||
| 	except exceptions.tokenNotFoundException: | 	except exceptions.tokenNotFoundException: | ||||||
| 		# Stop spectating if token not found | 		# Stop spectating if token not found | ||||||
| 		log.warning("Spectator can't spectate: token not found") | 		log.warning("Spectator can't spectate: token not found") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user