diff --git a/synapse/handlers/search.py b/synapse/handlers/search.py
index 65255804f66c4e73e89a5b5cde73e84887228928..e1fb2db0c9b8d8bdc973420efcf9e5cb16acf261 100644
--- a/synapse/handlers/search.py
+++ b/synapse/handlers/search.py
@@ -209,7 +209,6 @@ class SearchHandler(BaseHandler):
                     res = results_map[room_events[-1].event_id]
                     pagination_token = res["pagination_token"]
 
-                if room_events:
                     group = room_groups.setdefault(room_id, {})
                     if pagination_token:
                         next_batch = encode_base64("%s\n%s\n%s" % (