diff options
author | Luke Barnard <lukeb@openmarket.com> | 2017-04-12 14:02:03 +0100 |
---|---|---|
committer | Luke Barnard <lukeb@openmarket.com> | 2017-04-12 14:02:03 +0100 |
commit | cf6121e3da30a3bbfe50d68546cc0b026802e5c8 (patch) | |
tree | bcede26fb6c04e5d42292a0658d7a35afd0075af /synapse/rest/client/v2_alpha | |
parent | Remove Unused ref to hs (diff) | |
download | synapse-cf6121e3da30a3bbfe50d68546cc0b026802e5c8.tar.xz |
More null-guard changes
Diffstat (limited to 'synapse/rest/client/v2_alpha')
-rw-r--r-- | synapse/rest/client/v2_alpha/read_marker.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/rest/client/v2_alpha/read_marker.py b/synapse/rest/client/v2_alpha/read_marker.py index bf5a96459c..95e8e39974 100644 --- a/synapse/rest/client/v2_alpha/read_marker.py +++ b/synapse/rest/client/v2_alpha/read_marker.py @@ -42,8 +42,8 @@ class ReadMarkerRestServlet(RestServlet): body = parse_json_object_from_request(request) - if "m.read" in body: - read_event_id = body["m.read"] + read_event_id = body.get("m.read", None) + if read_event_id: yield self.receipts_handler.received_client_receipt( room_id, "m.read", @@ -51,8 +51,8 @@ class ReadMarkerRestServlet(RestServlet): event_id=read_event_id ) - if "m.read_marker" in body: - read_marker_event_id = body["m.read_marker"] + read_marker_event_id = body.get("m.read_marker", None) + if read_marker_event_id: yield self.read_marker_handler.received_client_read_marker( room_id, user_id=requester.user.to_string(), |