From 74081ff2d522afae796dbbae289d89da37f7fdc5 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Tue, 24 Oct 2017 15:40:55 -0700 Subject: [PATCH] Add assert() on stream_topic in get_recipient_info(). --- zerver/lib/actions.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 8ee1a63456..74565d6423 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -804,6 +804,12 @@ RecipientInfoResult = TypedDict('RecipientInfoResult', { def get_recipient_info(recipient, sender_id, stream_topic): # type: (Recipient, int, Optional[StreamTopicTarget]) -> RecipientInfoResult + if recipient.type == Recipient.STREAM: + # Anybody calling us w/r/t a stream message needs to supply + # stream_topic. We may eventually want to have different versions + # of this function for different message types. + assert(stream_topic is not None) + stream_push_user_ids = set() # type: Set[int] if recipient.type == Recipient.PERSONAL: