Skip to content

Commit

Permalink
Prevent errors when updating without a player
Browse files Browse the repository at this point in the history
Fixes #1052
Fixes #1074
  • Loading branch information
cookpete committed Nov 15, 2020
1 parent c6e87c5 commit 3ad995e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export default class Player extends Component {
}

componentDidUpdate (prevProps) {
// If there isn’t a player available, don’t do anything
if (!this.player) {
return
}
// Invoke player methods based on changed props
const { url, playing, volume, muted, playbackRate, pip, loop, activePlayer } = this.props
if (!isEqual(prevProps.url, url)) {
Expand Down

0 comments on commit 3ad995e

Please sign in to comment.