From f26e85ded36bc6fd7ea58d9589b975730dfe119f Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Mon, 21 May 2018 18:58:32 +0000 Subject: [PATCH] widgets: Fix tracebacks for events without messages. We could get submessage events for messages that weren't in our message store if somebody played with a widget that was on an "old" message for somebody else. --- static/js/widgetize.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/js/widgetize.js b/static/js/widgetize.js index a1b2c5fa1a..d623580416 100644 --- a/static/js/widgetize.js +++ b/static/js/widgetize.js @@ -67,6 +67,13 @@ exports.activate = function (in_opts) { exports.handle_event = function (widget_event) { var message = message_store.get(widget_event.message_id); + if (!message) { + // It is common for submessage events to arrive on + // messages that we don't yet have in storage. We + // just ignore them completely here. + return; + } + var events = [widget_event]; message.widget.handle_events(events);