Fix crash when attempting to id empty stream

This commit is contained in:
Max Goodhart
2020-07-02 13:59:28 -07:00
parent aaac169a58
commit 8e600f46d9

View File

@@ -84,7 +84,12 @@ export class StreamIDGenerator {
if (!localIdMap.has(link)) {
let counter = 0
let newId
const normalizedText = (source || label || link)
const idBase = source || label || link
if (!idBase) {
console.warn('skipping empty stream', stream)
continue
}
const normalizedText = idBase
.toLowerCase()
.replace(/[^\w]/g, '')
.replace(/^the|^https?(www)?/, '')