Skip to content

Commit

Permalink
Fix undefined scrollContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienCozeDev committed Jul 10, 2023
1 parent e22cfac commit a3a797f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pod/playlist/static/playlist/js/playlist-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function switchToNextVideo() {
function scrollToSelectedVideo() {
const scrollContainer = document.querySelector('.scroll-container');
const selectedVideo = document.querySelector('.selected');
if (selectedVideo) {
if (selectedVideo && scrollContainer) {
const containerRect = scrollContainer.getBoundingClientRect();
const selectedRect = selectedVideo.getBoundingClientRect();
const offsetTop = selectedRect.top - containerRect.top;
Expand Down

0 comments on commit a3a797f

Please sign in to comment.