From b1204888578233b846790d1c33dfe6f4a8211d75 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 3 Jun 2020 10:39:28 +0100 Subject: [PATCH] add null-guard for Autocomplete containerRef Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/Autocomplete.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/Autocomplete.tsx b/src/components/views/rooms/Autocomplete.tsx index 63f31c07b9..f5cf1a981c 100644 --- a/src/components/views/rooms/Autocomplete.tsx +++ b/src/components/views/rooms/Autocomplete.tsx @@ -260,7 +260,7 @@ export default class Autocomplete extends React.PureComponent { behavior: "auto", block: "nearest", }); - } else { + } else if (this.containerRef.current) { this.containerRef.current.scrollTo({ top: 0 }); } }