mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +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} .
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user