Skip to content

Commit c71301c

Browse files
committed
Ensure that positioning $window doesn't happen if it isn't present.
1 parent 7228330 commit c71301c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/buildplayer.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,16 @@
207207
let preferences, $window;
208208
preferences = this.getPref();
209209
$window = ( which === 'transcript' ) ? this.$transcriptArea : this.$signWindow;
210-
if ( which === 'transcript' ) {
210+
console.log( $window );
211+
if ( which === 'transcript' && $window ) {
211212
if (typeof preferences.transcript !== 'undefined') {
212213
this.prevTranscriptPosition = preferences.transcript;
213214
}
214215
$window.css({
215216
'top': 0,
216217
'left': 0
217218
});
218-
} else {
219+
} else if ( 'sign' === which && $window ) {
219220
if (typeof preferences.sign !== 'undefined') {
220221
this.prevSignPosition = preferences.sign;
221222
}
@@ -234,6 +235,9 @@
234235

235236
preferences = this.getPref();
236237
$window = ( which === 'transcript' ) ? this.$transcriptArea : this.$signWindow;
238+
if ( ! $window ) {
239+
return;
240+
}
237241
if (which === 'transcript') {
238242
if (typeof preferences.transcript !== 'undefined') {
239243
preferencePos = preferences.transcript;

0 commit comments

Comments
 (0)