Skip to content

Commit

Permalink
Handle zero length sample arrays (#1728)
Browse files Browse the repository at this point in the history
  • Loading branch information
turner authored Nov 3, 2023
1 parent 4135162 commit 5d1ff4d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/trackView.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,15 +378,20 @@ class TrackView {
repaintSampleInfo() {
if (typeof this.track.getSamples === 'function') {
const samples = this.track.getSamples()
this.sampleInfoViewport.repaint(samples)
if (samples.names && samples.names.length > 0) {
this.sampleInfoViewport.repaint(samples)
}
}
}

repaintSamples() {

if (typeof this.track.getSamples === 'function') {
const samples = this.track.getSamples()
this.sampleNameViewport.repaint(samples)
if (samples.names && samples.names.length > 0) {
this.sampleNameViewport.repaint(samples)
}

}
}

Expand Down

0 comments on commit 5d1ff4d

Please sign in to comment.