Fix scrollIntoView null error