Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

widgets: Fix bug where `process_submessages()` was run for empty rows.

N-Shar-ma68c83bce4400
diff --git a/web/src/submessage.ts b/web/src/submessage.ts
index 7b754b9886c..1e2500bf516 100644
--- a/web/src/submessage.ts
+++ b/web/src/submessage.ts
@@ -90,8 +90,9 @@ export function get_message_events(message: Message): SubmessageEvents | undefin
export function process_widget_rows_in_list(list: MessageList | undefined): void {
for (const message_id of widgetize.widget_event_handlers.keys()) {
- if (list?.get(message_id) !== undefined) {
- process_submessages({message_id, $row: list.get_row(message_id)});
+ const $row = list?.get_row(message_id);
+ if ($row && $row.length !== 0) {
+ process_submessages({message_id, $row});
}
}
}