mirror of https://git.48k.eu/ogclient
(BUG) Fix crash when json message received is incomplete
parent
445497fe01
commit
db7cc0d99e
|
@ -34,7 +34,12 @@ class HTTPParser:
|
|||
if not self.contentLen == 0:
|
||||
msgs = self.headersAlone.rstrip().split('\n')
|
||||
cmd = msgs[len(msgs) - 1]
|
||||
jsoncmd = json.loads(cmd)
|
||||
try:
|
||||
jsoncmd = json.loads(cmd)
|
||||
except ValueError as e:
|
||||
print ("Error: Json message incomplete")
|
||||
return
|
||||
|
||||
if "run" in cmd:
|
||||
self.cmd = jsoncmd["run"]
|
||||
|
||||
|
|
Loading…
Reference in New Issue