Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
subscriptions: Check if user is present in sub list before removing.
Shubham Padia4cda80349589
diff --git a/zerver/lib/events.py b/zerver/lib/events.pyindex 0ea4e442d0f..cecf5967214 100644--- a/zerver/lib/events.py+++ b/zerver/lib/events.py@@ -1658,7 +1658,8 @@ def apply_event(subscriber_key = ("subscribers" if "subscribers" in sub else "partial_subscribers")- sub[subscriber_key].remove(user_profile.id)+ if user_profile.id in sub[subscriber_key]:+ sub[subscriber_key].remove(user_profile.id)state["unsubscribed"] += removed_subs