aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAjay <[email protected]>2024-04-30 20:54:54 -0400
committerAjay <[email protected]>2024-04-30 20:54:54 -0400
commit3be51c89a9bf8c086172f8bb5a8efa83d0193523 (patch)
tree75a192225834b96bd2231e8856c4a8cdb5748e49 /src
parent5b845a56e10e9878025a28e4d85d7e5c53b4817d (diff)
downloadSponsorBlock-3be51c89a9bf8c086172f8bb5a8efa83d0193523.tar.gz
SponsorBlock-3be51c89a9bf8c086172f8bb5a8efa83d0193523.zip
Fix popup sometimes saying "No video found"
Fixes #2006 Fixes #2013 Fixes #1999
Diffstat (limited to 'src')
-rw-r--r--src/content.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/content.ts b/src/content.ts
index f67ba684..5a9569ca 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -219,7 +219,7 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
found: sponsorDataFound,
status: lastResponseStatus,
sponsorTimes: sponsorTimes,
- time: getVideo().currentTime,
+ time: getVideo()?.currentTime ?? 0,
onMobileYouTube: isOnMobileYouTube()
});
@@ -1183,7 +1183,7 @@ async function sponsorsLookup(keepOldSubmissions = true) {
found: sponsorDataFound,
status: lastResponseStatus,
sponsorTimes: sponsorTimes,
- time: getVideo().currentTime,
+ time: getVideo()?.currentTime ?? 0,
onMobileYouTube: isOnMobileYouTube()
});