summary refs log tree commit diff
path: root/synapse/storage/stream.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/storage/stream.py')
-rw-r--r--synapse/storage/stream.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index 67e7e6a76f..6a724193e1 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -199,12 +199,13 @@ class StreamStore(SQLBaseStore):
         if from_key == to_key:
             defer.returnValue(([], from_key))
 
-        has_changed = yield self._events_stream_cache.get_room_has_changed(
-            room_id, from_id
-        )
+        if from_id:
+            has_changed = yield self._events_stream_cache.get_room_has_changed(
+                room_id, from_id
+            )
 
-        if not has_changed:
-            defer.returnValue(([], from_key))
+            if not has_changed:
+                defer.returnValue(([], from_key))
 
         def f(txn):
             if from_id is not None: