summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorNeil Johnson <neil@ly.st>2018-01-26 20:22:40 +0000
committerGitHub <noreply@github.com>2018-01-26 20:22:40 +0000
commite98f0f911277a31c006a98c01a2c9a73ff38e447 (patch)
treedb517bc7ca9026e6347a8632f3043f4b37ea9d13 /synapse
parentRemove spurious unittest.DEBUG (diff)
parentadd white space line (diff)
downloadsynapse-e98f0f911277a31c006a98c01a2c9a73ff38e447.tar.xz
Merge pull request #2827 from matrix-org/fix_server_500_on_public_rooms_call_when_no_rooms_exist
Fix server 500 on public rooms call when no rooms exist
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/room_list.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/handlers/room_list.py b/synapse/handlers/room_list.py
index bb40075387..dfa09141ed 100644
--- a/synapse/handlers/room_list.py
+++ b/synapse/handlers/room_list.py
@@ -203,7 +203,8 @@ class RoomListHandler(BaseHandler):
         if limit:
             step = limit + 1
         else:
-            step = len(rooms_to_scan)
+            # step cannot be zero
+            step = len(rooms_to_scan) if len(rooms_to_scan) != 0 else 1
 
         chunk = []
         for i in xrange(0, len(rooms_to_scan), step):