Skip to content
Snippets Groups Projects
Commit cf6121e3 authored by Luke Barnard's avatar Luke Barnard
Browse files

More null-guard changes

parent c0aba0a2
No related branches found
No related tags found
No related merge requests found
...@@ -42,8 +42,8 @@ class ReadMarkerRestServlet(RestServlet): ...@@ -42,8 +42,8 @@ class ReadMarkerRestServlet(RestServlet):
body = parse_json_object_from_request(request) body = parse_json_object_from_request(request)
if "m.read" in body: read_event_id = body.get("m.read", None)
read_event_id = body["m.read"] if read_event_id:
yield self.receipts_handler.received_client_receipt( yield self.receipts_handler.received_client_receipt(
room_id, room_id,
"m.read", "m.read",
...@@ -51,8 +51,8 @@ class ReadMarkerRestServlet(RestServlet): ...@@ -51,8 +51,8 @@ class ReadMarkerRestServlet(RestServlet):
event_id=read_event_id event_id=read_event_id
) )
if "m.read_marker" in body: read_marker_event_id = body.get("m.read_marker", None)
read_marker_event_id = body["m.read_marker"] if read_marker_event_id:
yield self.read_marker_handler.received_client_read_marker( yield self.read_marker_handler.received_client_read_marker(
room_id, room_id,
user_id=requester.user.to_string(), user_id=requester.user.to_string(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment