Skip to content

Commit

Permalink
fix(ui): null pointer when scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-urbanski-freiheit-com committed Nov 19, 2024
1 parent 5571e1f commit 6e96d18
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ export const ServiceLane: React.FC<{
if (document.getElementsByClassName('mdc-drawer-app-content').length !== 0) {
document.getElementsByClassName('mdc-drawer-app-content')[0].addEventListener('scroll', handleScroll);
return () => {
document
.getElementsByClassName('mdc-drawer-app-content')[0]
.removeEventListener('scroll', handleScroll);
const elem = document.getElementsByClassName('mdc-drawer-app-content')[0];
if (elem) {
elem.removeEventListener('scroll', handleScroll);
}
};
}
}, [appDetails, application, authHeader, searchParams]);
Expand Down

0 comments on commit 6e96d18

Please sign in to comment.