diff --git a/web/src/message_list.ts b/web/src/message_list.ts index 78604f489a..ab60d4d519 100644 --- a/web/src/message_list.ts +++ b/web/src/message_list.ts @@ -428,8 +428,8 @@ export class MessageList { let deactivated = false; let just_unsubscribed = false; const subscribed = stream_data.is_subscribed(stream_id); - const invite_only = sub && sub.invite_only; - const is_web_public = sub && sub.is_web_public; + const invite_only = sub?.invite_only; + const is_web_public = sub?.is_web_public; const can_toggle_subscription = sub !== undefined && stream_data.can_toggle_subscription(sub); if (sub === undefined) { diff --git a/web/src/user_profile.ts b/web/src/user_profile.ts index 07645a1eee..71d071a40b 100644 --- a/web/src/user_profile.ts +++ b/web/src/user_profile.ts @@ -323,7 +323,7 @@ function render_user_stream_list(streams: StreamSubscription[], user: User): voi filter: { $element: $("#user-profile-streams-tab .stream-search"), predicate(item, value) { - return item && item.name.toLocaleLowerCase().includes(value); + return item?.name.toLocaleLowerCase().includes(value); }, onupdate() { if ($container.find(".empty-table-message").length) {