Skip to content

Commit

Permalink
small patch for undefined error
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedmor committed Jun 5, 2023
1 parent 9c8e9b1 commit 253aa7a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions octoprint_multicam/static/js/multicam.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ $(function () {
//console.log("DEBUGG Webcam visibility change",self.webcams)
const visible = self.webcams.find((webcam) => webcam[0].classList.contains("active"));

if ($(visible[0]).find('.webcam_image').attr("src") !== self.WebCamSettings.streamUrlEscaped()) {
this.loadWebcam(visible);
if (visible !== undefined) {
if ($(visible[0]).find('.webcam_image').attr("src") !== self.WebCamSettings.streamUrlEscaped()) {
this.loadWebcam(visible);
}
}
};

Expand Down

0 comments on commit 253aa7a

Please sign in to comment.