[SearchProfiler] Fix console error message when umounting (#50105)

* Safer access of input ref

* Remove unnecessary "!" [skip ci]
This commit is contained in:
Jean-Louis Leysens 2019-11-11 09:42:36 -05:00 committed by GitHub
parent e2d3c87269
commit 0491589d50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,8 +86,10 @@ export const ProfileQueryEditor = memo(() => {
<EuiFieldText
disabled={!licenseEnabled}
inputRef={ref => {
indexInputRef.current = ref!;
ref!.value = DEFAULT_INDEX_VALUE;
if (ref) {
indexInputRef.current = ref;
ref.value = DEFAULT_INDEX_VALUE;
}
}}
/>
</EuiFormRow>