diff --git a/packages/react/src/google-translate-select.tsx b/packages/react/src/google-translate-select.tsx index dd0e7fe..f10a9ad 100644 --- a/packages/react/src/google-translate-select.tsx +++ b/packages/react/src/google-translate-select.tsx @@ -319,11 +319,12 @@ export default function GoogleTranslateSelect(props: IGoogleTranslateProps) { const selectValue = isString(select) ? select : select.value ?? '' const googleTranslateOriginalSelectEl = document.querySelector( GOOGLE_TRANSLATE_ORIGINAL_SELECT_CLASSNAME - ) as HTMLSelectElement + ) as HTMLSelectElement | null const googleTranslateSelectEl = document.querySelector(`.${ns.b()}`) if ( !googleTranslateSelectEl || + !googleTranslateOriginalSelectEl || googleTranslateSelectEl.innerHTML.length === 0 || googleTranslateOriginalSelectEl.options.length === 0 ) {