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.

stream_data: Check for null more explicitly.

evykassirer2be181c36789
diff --git a/web/src/stream_data.ts b/web/src/stream_data.ts
index 9cdfdd3cfa2..8c5e81d28ac 100644
--- a/web/src/stream_data.ts
+++ b/web/src/stream_data.ts
@@ -273,7 +273,7 @@ export function slug_to_stream_id(slug: string): number | undefined {
// "New" (2018) format: ${stream_id}-${stream_name} .
const match = /^(\d+)(?:-.*)?$/.exec(slug);
const newFormatStreamId = match ? Number.parseInt(match[1]!, 10) : null;
- if (newFormatStreamId && stream_info.get(newFormatStreamId)) {
+ if (newFormatStreamId !== null && stream_info.get(newFormatStreamId)) {
return newFormatStreamId;
}