diff --git a/ui/components/app/account-menu/account-menu.component.js b/ui/components/app/account-menu/account-menu.component.js index f6c5b75df..aec8decfb 100644 --- a/ui/components/app/account-menu/account-menu.component.js +++ b/ui/components/app/account-menu/account-menu.component.js @@ -253,12 +253,13 @@ export default class AccountMenu extends Component { } setShouldShowScrollButton = () => { + if (!this.accountsRef) { + return; + } + const { scrollTop, offsetHeight, scrollHeight } = this.accountsRef; - const canScroll = scrollHeight > offsetHeight; - const atAccountListBottom = scrollTop + offsetHeight >= scrollHeight; - const shouldShowScrollButton = canScroll && !atAccountListBottom; this.setState({ shouldShowScrollButton });