mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 18:06:44 +00:00
stream_data: Check for null more explicitly.
Otherwise 0 is treated specially, different from other numbers.
This commit is contained in:
@@ -273,7 +273,7 @@ export function slug_to_stream_id(slug: string): number | undefined {
|
|||||||
// "New" (2018) format: ${stream_id}-${stream_name} .
|
// "New" (2018) format: ${stream_id}-${stream_name} .
|
||||||
const match = /^(\d+)(?:-.*)?$/.exec(slug);
|
const match = /^(\d+)(?:-.*)?$/.exec(slug);
|
||||||
const newFormatStreamId = match ? Number.parseInt(match[1]!, 10) : null;
|
const newFormatStreamId = match ? Number.parseInt(match[1]!, 10) : null;
|
||||||
if (newFormatStreamId && stream_info.get(newFormatStreamId)) {
|
if (newFormatStreamId !== null && stream_info.get(newFormatStreamId)) {
|
||||||
return newFormatStreamId;
|
return newFormatStreamId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user