Fixed issue with log entries without exception stack

This commit is contained in:
morpheus65535 2021-03-25 14:51:51 -04:00
parent 54eb0fc174
commit ac8eb62de0
1 changed files with 3 additions and 2 deletions

View File

@ -521,8 +521,9 @@ class SystemLogs(Resource):
log["timestamp"] = lin[0]
log["type"] = lin[1].rstrip()
log["message"] = lin[3]
if lin[4] != '\n':
log['exception'] = lin[4].strip('\'').replace(' ', '\u2003\u2003')
if len(lin) > 4:
if lin[4] != '\n':
log['exception'] = lin[4].strip('\'').replace(' ', '\u2003\u2003')
logs.append(log)
logs.reverse()
return jsonify(data=logs)