Skip to content

Commit ee3aad0

Browse files
chrisbobbegnprice
authored andcommitted
internalLinks [nfc]: Bring out a local, to be reused soon
1 parent 01eed63 commit ee3aad0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/internalLinks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ export const decodeHashComponent = (string: string): string => {
7373
const parseStreamOperand = (operand, streamsById, streamsByName): null | Stream => {
7474
// "New" (2018) format: ${stream_id}-${stream_name} .
7575
const match = /^([\d]+)(?:-.*)?$/.exec(operand);
76-
if (match) {
77-
const streamId = parseInt(match[1], 10);
78-
const stream = streamsById.get(streamId);
76+
const newFormatStreamId = match ? parseInt(match[1], 10) : null;
77+
if (newFormatStreamId != null) {
78+
const stream = streamsById.get(newFormatStreamId);
7979
if (stream) {
8080
return stream;
8181
}

0 commit comments

Comments
 (0)