From 5b9b0990accf95e45b7d83aa2037cdd21732aa80 Mon Sep 17 00:00:00 2001 From: turner Date: Thu, 2 Nov 2023 15:58:48 -0400 Subject: [PATCH] Handle zero length sample arrays --- js/trackView.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/trackView.js b/js/trackView.js index 2b29291ad..a65ba4f4d 100644 --- a/js/trackView.js +++ b/js/trackView.js @@ -378,7 +378,9 @@ 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) + } } } @@ -386,7 +388,10 @@ class TrackView { 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) + } + } }