Avoid Cannot read property 'left' of undefined at utils.setScrollPosition

function setScrollPosition ({left = 0, top = 0}) { console.log(left, top)};

setScrollPosition(undefined)

This will have TypeError
This commit is contained in:
Chad Liu
2019-09-12 10:59:42 +08:00
parent 4162f4f7d1
commit 3d632fa017
+1 -1
View File
@@ -3,7 +3,7 @@ import utils from './utils';
class FullScreen {
constructor (player) {
this.player = player;
this.lastScrollPosition = {left: 0, top: 0};
this.player.events.on('webfullscreen', () => {
this.player.resize();
});