From 0e12c9b5f5dafb8afc775bf51e02361e93e26664 Mon Sep 17 00:00:00 2001 From: An Duong Date: Tue, 21 Nov 2023 17:53:28 -0500 Subject: [PATCH] Fix crash when text attr is not avialable in SHOW_TOTAL_CODE_TIME --- sources/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/main.py b/sources/main.py index 4c3ec221..37abe5b0 100644 --- a/sources/main.py +++ b/sources/main.py @@ -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...")