Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit 291630e

Browse files
committed
Handle not receiving a profile for a user in heroes
1 parent d38aded commit 291630e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

synapse/handlers/sync.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -844,13 +844,18 @@ async def compute_summary(
844844
summary["m.heroes"],
845845
)
846846
summary["com.beeper.m.heroes"] = [
847-
{"mxid": mxid, "display_name": profile.display_name}
847+
{
848+
"mxid": mxid,
849+
"display_name": profile.display_name
850+
if profile is not None
851+
else None,
852+
}
848853
for mxid, profile in profiles.items()
849854
if not mxid.startswith("@_") # filter out bot users
850855
]
851-
except Exception:
856+
except Exception as e:
852857
logger.warning(
853-
f"Error generating heroes for room {room_id} profiles {profiles}"
858+
f"Error generating heroes for room {room_id} profiles {profiles} error {e}"
854859
)
855860
raise
856861

0 commit comments

Comments
 (0)