Skip to content

Commit

Permalink
🐛 Add another guard when accessing tokenLinesForScreenRows
Browse files Browse the repository at this point in the history
I hope it’ll provide some insight on what’s happening with #481
  • Loading branch information
abe33 committed May 25, 2016
1 parent 840e566 commit 80fd653
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/mixins/canvas-drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,11 @@ export default class CanvasDrawer extends Mixin {
const context = this.tokensLayer.context
const {width: canvasWidth} = this.tokensLayer.getSize()

if (!this.tokenLinesForScreenRows) { return }
if (typeof this.tokenLinesForScreenRows != 'function') {
console.error(`tokenLinesForScreenRows should be a function but it was ${typeof this.tokenLinesForScreenRows}`, this.tokenLinesForScreenRows)

return
}

const screenRowsTokens = this.tokenLinesForScreenRows(firstRow, lastRow)

Expand Down

0 comments on commit 80fd653

Please sign in to comment.