aboutsummaryrefslogtreecommitdiffstats
path: root/src/js
diff options
context:
space:
mode:
authorOliver <oemueller@gmail.com>2017-07-12 22:17:25 +0200
committerGitHub <noreply@github.com>2017-07-12 22:17:25 +0200
commitb114a6f42edd4ecb2b760c20151477a9f6119370 (patch)
treec6000a7f5c3a2e0717d85fb90a24360af2cfe6a9 /src/js
parent6828bc00f8c06b30470a103d53530196e0253e6c (diff)
downloadplyr-b114a6f42edd4ecb2b760c20151477a9f6119370.tar.lz
plyr-b114a6f42edd4ecb2b760c20151477a9f6119370.tar.xz
plyr-b114a6f42edd4ecb2b760c20151477a9f6119370.zip
[bugfix] target is null exception
when using 'play-large' without a 'play' button, the statement target = target[0]; caused an error. So it is necessary to check the value of target before accessing [0]
Diffstat (limited to 'src/js')
-rw-r--r--src/js/plyr.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 352e0114..d50b19a1 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -2850,10 +2850,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