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.

typing: Fix "Missing stream_id" server error.

Prakhar Pratyushf023a11d0117
diff --git a/web/src/typing.ts b/web/src/typing.ts
index 002ee47d159..1ef4e770e8b 100644
--- a/web/src/typing.ts
+++ b/web/src/typing.ts
@@ -119,7 +119,11 @@ export function get_recipient(): Recipient | null {
}
if (message_type === "stream") {
const stream_name = compose_state.stream_name();
- const stream_id = stream_data.get_stream_id(stream_name)!;
+ const stream_id = stream_data.get_stream_id(stream_name);
+ if (stream_id === undefined) {
+ // compose box with no stream selected.
+ return null;
+ }
const topic = compose_state.topic();
return {
message_type: "stream",