Only add the user_id if the sender is present

pull/402/head
Mark Haines 2015-12-01 11:14:48 +00:00
parent bde8d78b8a
commit 306415391d
1 changed files with 3 additions and 1 deletions

View File

@ -102,7 +102,9 @@ def format_event_raw(d):
def format_event_for_client_v1(d):
d = format_event_for_client_v2(d)
d["user_id"] = d.get("sender", None)
sender = d.get("sender")
if sender is not None:
d["user_id"] = sender
copy_keys = (
"age", "redacted_because", "replaces_state", "prev_content",