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
if resp['command'] == 'error':
if data and resp['keys']['id'] == '0':
if len(data) > 1:
return data
if resp['keys']['id'] == '0':
if data:
if len(data) > 1:
return data
else:
return data[0]
else:
return data[0]
return resp['keys']['id']
else:
raise TeamspeakError(resp['keys']['id'])