Skip to content

Commit

Permalink
fix: null pointer exception on destroy
Browse files Browse the repository at this point in the history
Appears when component is destroyed right after being mounted.
Because `this.camera` hasn't been instanciated yet but it's
`stop()` function is already called.

Close #44
  • Loading branch information
gruhn committed Jul 5, 2018
1 parent a6b3ae9 commit ae9fa90
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/QrcodeReader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ export default {
},
beforeDestroy () {
this.camera.stop()
if (this.camera !== null) {
this.camera.stop()
}
this.destroyed = true
},
Expand Down

0 comments on commit ae9fa90

Please sign in to comment.