subs: Fix exception with streams overlay open but no active stream.

Previously, if you had the streams overlay open (but no active stream
clicked) while another user edited your subscriptions state, we'd
throw an exception handle the get_events call, because the code for
rerendering the subscribers list didn't consider the possibility that
there was no active stream.
This commit is contained in:
Tim Abbott
2017-10-23 22:56:14 -07:00
parent 9d0e1a2e0c
commit 1978455287

View File

@@ -223,7 +223,7 @@ exports.update_settings_for_subscribed = function (sub) {
}
var active_stream = exports.active_stream();
if (active_stream.stream_id === sub.stream_id) {
if (active_stream !== undefined && active_stream.stream_id === sub.stream_id) {
stream_edit.rerender_subscribers_list(sub);
}
@@ -243,7 +243,7 @@ exports.update_settings_for_unsubscribed = function (sub) {
stream_edit.hide_sub_settings(sub);
var active_stream = exports.active_stream();
if (active_stream.stream_id === sub.stream_id) {
if (active_stream !== undefined && active_stream.stream_id === sub.stream_id) {
stream_edit.rerender_subscribers_list(sub);
}