prevent error being raised on OK empty response

closes #554
This commit is contained in:
Adarnof 2016-10-18 13:45:15 -04:00 committed by GitHub
parent e242b8cfec
commit deb94c06fd

View File

@ -72,11 +72,14 @@ class TS3Proto:
break break
if resp['command'] == 'error': if resp['command'] == 'error':
if data and resp['keys']['id'] == '0': if resp['keys']['id'] == '0':
if len(data) > 1: if data:
return data if len(data) > 1:
return data
else:
return data[0]
else: else:
return data[0] return resp['keys']['id']
else: else:
raise TeamspeakError(resp['keys']['id']) raise TeamspeakError(resp['keys']['id'])