add null-guard for Autocomplete containerRef

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2020-06-03 10:39:28 +01:00
parent 66a945b26c
commit b120488857
1 changed files with 1 additions and 1 deletions

View File

@ -260,7 +260,7 @@ export default class Autocomplete extends React.PureComponent<IProps, IState> {
behavior: "auto",
block: "nearest",
});
} else {
} else if (this.containerRef.current) {
this.containerRef.current.scrollTo({ top: 0 });
}
}