mirror of https://github.com/zulip/zulip.git
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.
This commit is contained in:
parent
80a331385e
commit
f26e85ded3
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue