You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems like a harmless issue where recolorNation is being called before window.onload populates the stateAbbreviations array. I got around this by catching the error.
function recolorNation(hashtag) {
// A function to go through every state and color it correctly for a given hashtag
try {
for ( var k = 0; k < stateAbbreviations.length; k++ ) {
var stateAbbreviation = stateAbbreviations[k];
var state = nation.getElementById(stateAbbreviation);
colorState(state, getIntervalAt(SOTUvideo.currentTime), hashtag);
}
}
catch(err) {
// throws this the first time it loads.
}
}
On page load, I get the error:
Uncaught TypeError: Cannot read property 'length' of null on line 165
After the page fully loads, the value is set.
The text was updated successfully, but these errors were encountered: