summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2019-02-21 17:42:15 +0000
committerGitHub <noreply@github.com>2019-02-21 17:42:15 +0000
commitb9d6756b1405fbebf952cd86d048637e7d1d2075 (patch)
treeb6430a9b3faffa6841fbc9ea7feecdf30c252e23
parentMerge pull request #4701 from fistons/fix-migration-script (diff)
parentPrevent crash on pagination. (diff)
downloadsynapse-b9d6756b1405fbebf952cd86d048637e7d1d2075.tar.xz
Merge pull request #4263 from rkfg/develop
Prevent crash on pagination.
-rw-r--r--changelog.d/4263.bugfix1
-rw-r--r--synapse/handlers/pagination.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.d/4263.bugfix b/changelog.d/4263.bugfix
new file mode 100644
index 0000000000..3dc1d7c732
--- /dev/null
+++ b/changelog.d/4263.bugfix
@@ -0,0 +1 @@
+Prevent crash on pagination.
diff --git a/synapse/handlers/pagination.py b/synapse/handlers/pagination.py
index 9d257ecf31..084c1503da 100644
--- a/synapse/handlers/pagination.py
+++ b/synapse/handlers/pagination.py
@@ -254,7 +254,7 @@ class PaginationHandler(object):
             })
 
         state = None
-        if event_filter and event_filter.lazy_load_members():
+        if event_filter and event_filter.lazy_load_members() and len(events) > 0:
             # TODO: remove redundant members
 
             # FIXME: we also care about invite targets etc.