fix crash when variable missing from cache

This commit is contained in:
Ajay Ramachandran
2020-12-28 18:47:51 -05:00
parent 63c3b1f56b
commit bb7cc60118

View File

@@ -19,7 +19,7 @@ function prepareCategorySegments(req: Request, videoID: VideoID, category: Categ
return true;
}
if (cache.shadowHiddenSegmentIPs[videoID] === undefined) {
if (cache?.shadowHiddenSegmentIPs[videoID] === undefined) {
cache.shadowHiddenSegmentIPs[videoID] = privateDB.prepare('all', 'SELECT hashedIP FROM sponsorTimes WHERE videoID = ?', [videoID]);
}