stream_data: Check for null more explicitly.

Otherwise 0 is treated specially, different from other numbers.
This commit is contained in:
evykassirer
2024-09-17 14:56:02 -07:00
committed by Tim Abbott
parent 2ad1dc7014
commit 2be181c367

View File

@@ -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;
}