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

Fix crash admin media list api when info is None #14537

Merged
merged 4 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/14536.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug in the media admin room list API crashing when an image event exists with broken thumbnail information. Contributed by @schmop.
schmop marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion synapse/storage/databases/main/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ def _get_media_mxcs_in_room_txn(
event_json = db_to_json(content_json)
content = event_json["content"]
content_url = content.get("url")
thumbnail_url = content.get("info", {}).get("thumbnail_url")
thumbnail_url = (content.get("info") or {}).get("thumbnail_url")
schmop marked this conversation as resolved.
Show resolved Hide resolved

for url in (content_url, thumbnail_url):
if not url:
Expand Down