diff --git a/content.js b/content.js index add0b940..0cd02940 100644 --- a/content.js +++ b/content.js @@ -379,11 +379,14 @@ function sponsorsLookup(id) { } function updatePreviewBar() { - let allSponsorTimes = sponsorTimes.concat(sponsorTimesSubmitting); + let localSponsorTimes = sponsorTimes; + if (localSponsorTimes == null) localSponsorTimes = []; + + let allSponsorTimes = localSponsorTimes.concat(sponsorTimesSubmitting); //create an array of the sponsor types let types = []; - for (let i = 0; i < sponsorTimes.length; i++) { + for (let i = 0; i < localSponsorTimes.length; i++) { types.push("sponsor"); } for (let i = 0; i < sponsorTimesSubmitting.length; i++) {