diff --git a/src/js/plyr.js b/src/js/plyr.js index d9949722..659f4f95 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -2980,10 +2980,12 @@ target = plyr.buttons[play ? "pause" : "play"]; // Get the last play button to account for the large play button - if (target && target.length > 1) { - target = target[target.length - 1]; - } else { - target = target[0]; + if (target) { + if (target.length > 1) { + target = target[target.length - 1]; + } else { + target = target[0]; + } } // Setup focus and tab focus