Skip to content

Commit

Permalink
Avoid IndexError after INSERT query (bryanyang0528#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
romainr committed Oct 22, 2020
1 parent 1b64b58 commit c610955
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ksql/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _raise_for_status(r, response):
raise KSQLError("Unknown Error: {}".format(r.content))
else:
# seems to be the old API behavior, so some errors have status 200, bug??
if r_json[0]["@type"] == "currentStatus" and r_json[0]["commandStatus"]["status"] == "ERROR":
if r_json and r_json[0]["@type"] == "currentStatus" and r_json[0]["commandStatus"]["status"] == "ERROR":
error_message = r_json[0]["commandStatus"]["message"]
error_code = None
stackTrace = None
Expand Down

0 comments on commit c610955

Please sign in to comment.