From ca61ccc9bd2a2111fe22419f4b56a07ec503f11b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 20 Jan 2016 23:38:03 +0100 Subject: [PATCH] Sistemato una cosina. --- steam.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/steam.py b/steam.py index e5adfc45..109c18c3 100644 --- a/steam.py +++ b/steam.py @@ -18,7 +18,10 @@ def getplayersummaries(steamid): } # Manda la richiesta ai server di Steam. r = requests.get("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/", params=parametri).json() - return r['response']['players'][0] + if len(r['response']['players']) > 0: + return r['response']['players'][0] + else: + raise NameError def getnumberofcurrentplayers(appid):