From 75d9f66bf0153aea69522ca3ec644678734b9ab1 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 23 Aug 2017 17:15:18 -0700 Subject: [PATCH] fix_unreads: Fix error handling with no recipient_ids. Previously, this would send an invalid database query to postgres. --- zerver/management/commands/fix_unreads.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zerver/management/commands/fix_unreads.py b/zerver/management/commands/fix_unreads.py index 50966e06a9..2869b67f7c 100644 --- a/zerver/management/commands/fix_unreads.py +++ b/zerver/management/commands/fix_unreads.py @@ -187,6 +187,9 @@ def fix_pre_pointer(cursor, user_profile): find_non_muted_recipients ) + if not recipient_ids: + return + user_message_ids = [] def find_old_ids():