remove code 500 on invalid npc

This commit is contained in:
Thomas Rubini 2023-03-19 12:06:05 +01:00
parent c2aeede354
commit 4438e8f2ff
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373

View File

@ -149,7 +149,7 @@ def get_npc_reaction():
image = game.get_npc_reaction(npc_id)
errors = ["npc not in game","error reading file"]
if image in [0,1]:
return {"error" :1, "msg": errors[image]} , 500
return {"error": 1, "msg": errors[image]}
response = flask.make_response(image)
response.headers.set('Content-Type', 'image/png')