From 9d75f5056fe174e62efe2bc28ca0198262059a4a Mon Sep 17 00:00:00 2001 From: rsashank Date: Mon, 4 Nov 2024 15:19:35 +0530 Subject: [PATCH] messages: Update poll_question with a default text if empty. This prevents an empty-title popup in the Poll Results view. --- zulipterminal/ui_tools/messages.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zulipterminal/ui_tools/messages.py b/zulipterminal/ui_tools/messages.py index 1c5a112f65..1ea76bd561 100644 --- a/zulipterminal/ui_tools/messages.py +++ b/zulipterminal/ui_tools/messages.py @@ -771,6 +771,11 @@ def main_view(self) -> List[Any]: else "No poll question provided. Please add one via the web app." ) + if not self.poll_question: + # If no poll question is provided, set a message to display + # in Poll Results popup. + self.poll_question = "No poll question provided." + if self.poll_options: max_votes_len = max( len(str(len(option["votes"])))