Skip to content

Commit bc4babb

Browse files
committed
fix: error when tracking disabled
Disabling tracking would still lead to frequent calls of the `trackRepaintFunction` which in this case caused to null pointer exceptions.
1 parent 0db0943 commit bc4babb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/components/QrcodeReader.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,9 @@ export default {
200200
},
201201
202202
onLocate (location) {
203-
location = this.normalizeLocation(location)
204-
205-
if (this.repaintTrack !== null) {
203+
if (this.trackRepaintFunction !== null) {
206204
this.repaintTrack(location)
207205
}
208-
209-
this.$emit('locate', location)
210206
},
211207
212208
/**
@@ -233,6 +229,8 @@ export default {
233229
},
234230
235231
repaintTrack (location) {
232+
location = this.normalizeLocation(location)
233+
236234
const canvas = this.$refs.trackingLayer
237235
const ctx = canvas.getContext('2d')
238236

0 commit comments

Comments
 (0)