Skip to content

Commit

Permalink
Fix crash when text attr is not avialable in SHOW_TOTAL_CODE_TIME
Browse files Browse the repository at this point in the history
  • Loading branch information
anduong96 committed Nov 21, 2023
1 parent 02827d6 commit 0e12c9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sources/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ async def get_stats() -> str:
if EM.SHOW_TOTAL_CODE_TIME:
DBM.i("Adding total code time info...")
data = await DM.get_remote_json("waka_all")
stats += f"![Code Time](http://img.shields.io/badge/{quote('Code Time')}-{quote(str(data['data']['text']))}-blue)\n\n"
code_time = data["data"]["text"] if hasattr(data["data"], "text") else data["message"]
stats += f"![Code Time](http://img.shields.io/badge/{quote('Code Time')}-{quote(str(code_time))}-blue)\n\n"

if EM.SHOW_PROFILE_VIEWS:
DBM.i("Adding profile views info...")
Expand Down

0 comments on commit 0e12c9b

Please sign in to comment.